Skip to content

Commit

Permalink
feat(controllers): generate user secret when visiting 2fa route
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Sep 17, 2023
1 parent 24f848b commit d329c8f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/controllers/users-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export const getUserSecretToken = async (req, res, next) => {

if (id) {
const user = users.findUserById(id);
await user.generateSecret();
const { secret, uri } = user.decryptSecret();

if (!user.mfaEnabled && isDev) {
Expand Down

0 comments on commit d329c8f

Please sign in to comment.