(email, secret)
| 598 | } |
| 599 | |
| 600 | generateQrCodeUrl(email, secret) { |
| 601 | const totp = new TOTP({ |
| 602 | secret, |
| 603 | issuer: "Chartbrew", |
| 604 | label: email, |
| 605 | digits: 6, |
| 606 | period: 30, |
| 607 | }); |
| 608 | |
| 609 | return totp.toString(); |
| 610 | } |
| 611 | |
| 612 | async setup2faApp(userId) { |
| 613 | const user = await this.findById(userId); |