Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to verify Backup Codes for pattern 'xxxx-xxxx-xxxx' #10

Open
MuhammadAbbasAkhtar opened this issue Apr 6, 2023 · 2 comments
Open

Comments

@MuhammadAbbasAkhtar
Copy link

verifyHOTP generates code in xxxxxx format

backup codes are in xxxx-xxxx-xxxx format

No method for verifying them is available.

How to do that?

@MuhammadAbbasAkhtar
Copy link
Author

Currently, the only solution I can think of is to hash the backup codes using bcrypt and store them in DB, and when the user logs in using the code, compare it via bcrypt.compareSync method

@oneyoung19
Copy link

Currently, the only solution I can think of is to hash the backup codes using bcrypt and store them in DB, and when the user logs in using the code, compare it via bcrypt.compareSync method

Yes, that's what I'm thinking. The recovery codes provided in this library are just utility functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants