Open
Description
I am running meteor app on Windows 10 with speakasy installed.
time.is reports:
Your time is exact!The difference from Time.is was -0.039 seconds (±0.013 seconds).
However the tokens do not match - at all.
This is my code:
verifyToken() {
var myToken = this.state.authCode.trim()
let currentValidToken = speakeasy.totp({ secret: this.secretBase32, encoding: 'base32' });
let verified = speakeasy.time.verify({
secret: this.secretBase32,
encoding: 'base32',
token: myToken
})
console.log(`mySecret = [${this.secretBase32}] CVT = [${currentValidToken}] MYTOKEN = ${myToken} VERIFIED= [${verified}]`);
if (!verified) {
return swal({
title: "Invalid Code",
text: "You have 2 more attempts.",
showConfirmButton: true,
type: "error"
});
} else {
return swal({
title: "Jackpot!",
text: "You da man.",
showConfirmButton: true,
type: "success"
});
}
}
Metadata
Metadata
Assignees
Labels
No labels