verify_tfa_code

verify_tfa_code Verifies that a TFA (Two Factor Authorization) code matches the one most recently sent via email using send_tfa_code

Format:

verify_tfa_code(code [,lifespan])

Parameters:

Parameter Type Description
code string The entered tfa to verify
lifespan string  [Optional]If, supplied, indicates the maximum lifespan (age) of the TFA in seconds. default is one hour(3600)

Returned Value:

Type Description
boolean true if the code verifies, false otherwise

Examples

 code = prompt("Authorization code?")
 verified = verify_tfa_code(code)
 if (!verified) {
    abort("You are not authorized!")
 }