How to view 2FA backup codes

Hey everyone! I'm trying to use this method from the 2FA feature of better-auth:
const data = await auth.api.viewBackupCodes({
body: {
userId: "user-id",
},
});
const data = await auth.api.viewBackupCodes({
body: {
userId: "user-id",
},
});
However, the return type of this function is single hex string of code, rather than list of the original codes. how can I correctly show the original codes to the user? https://www.better-auth.com/docs/plugins/2fa#viewing-backup-codes
Two-Factor Authentication (2FA) | Better Auth
Enhance your app's security with two-factor authentication.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?