Browse Source

refactor(users): 重新启用两步验证功能

- 移除了之前注释掉的两步验证代码
- 恢复了两步验证逻辑的执行
wuyi 1 year ago
parent
commit
4f0359dfdb
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/users/users.service.ts

+ 3 - 3
src/users/users.service.ts

@@ -144,9 +144,9 @@ export class UsersService implements OnModuleInit {
         if (!isMatch) {
             throw new UnauthorizedException('Username and password doesn\'t match')
         }
-        // if (users.twoFactorCode) {
-        //     return 'success'
-        // }
+        if (users.twoFactorCode) {
+            return 'success'
+        }
         const key = await generateKey(username)
         console.log('key', key)
         users.twoFactorCode = key.secret