Private
Optional
_sendPrivate
generatePrivate
generatePrivate
gracePrivate
hashPrivate
maxPrivate
storagePrivate
storagePrivate
storagePrivate
timePrivate
timePrivate
calculatePrivate
getIssues a new token
arguments passed to sendOtp
Optional
customData: Dataany JSON-encodable data can be embedded into the token
Private
sendPrivate
setGenerated using TypeDoc
Check the solution of the token. Default behavior is to invalidate the token when it is solved correctly.
Last option allowReuseOfSolvedToken allows to mark the token as solved instead of invalidating it, so that it can be checked inside another API route with getTokenInformation function. If this option is used, the developer is responsible to invalidating the token after use.
Usefull when solved token will be sent to another endpoint. It is the only way to keep logic not pretaining to otp solving outside of otp endpoints, Otherwise everything goes through otp handlers and it gets messy very quickly. Simply send solved token to an API endpoint, and
allowReuseOfSolvedToken should be set to true if validation of multiple tokens is required. For example, when phone and email needs to be validated before registration. While multiple otps are solved, we want to keep them existing in the cache before proceeding to registration