2FA Totp
Hello, i wanna add 2fa TOTP to credentials login. How can i generate a QR code for user to scan ?

Solution:Jump to solution
That's out of Better-Auth's scope at what we provide. You should find a library that does this
6 Replies
My current code is this. I enter the password and i need to somehow show a QR code. But how ?

Solution
That's out of Better-Auth's scope at what we provide. You should find a library that does this
This might help: https://www.npmjs.com/package/qrcode
npm
qrcode
QRCode / 2d Barcode api with both server side and client side support using canvas. Latest version: 1.5.4, last published: 8 months ago. Start using qrcode in your project by running
npm i qrcode
. There are 3278 other projects in the npm registry using qrcode.Okay thanks i will look at it. And one think. Does it generate backup codes after the user verify the 2fa code or ?
no, that would have to be implemented separately.
So the user verify a password then show QR code and then show backup codes ?
Ohh i see now :9367kekwlaugh: