migration change on default value and encrypted storage
This commit is contained in:
parent
03a5bb3592
commit
a476bf6823
11 changed files with 82 additions and 36 deletions
|
@ -31,7 +31,9 @@ export async function getMeById(req: Request, res: Response): Promise<any> {
|
|||
export async function getMyTotp(req: Request, res: Response): Promise<any> {
|
||||
const userId = req.userId;
|
||||
|
||||
let { secret } = await UserService.getById(userId);
|
||||
let { secret, routine } = await UserService.getUserSecretAndRoutine(userId);
|
||||
|
||||
console.log(secret);
|
||||
|
||||
const url = `otpauth://totp/FF Admin ${SettingHelper.getSetting("club.name")}?secret=${secret}`;
|
||||
|
||||
|
@ -57,7 +59,7 @@ export async function verifyMyTotp(req: Request, res: Response): Promise<any> {
|
|||
const userId = req.userId;
|
||||
let totp = req.body.totp;
|
||||
|
||||
let { secret } = await UserService.getById(userId);
|
||||
let { secret, routine } = await UserService.getUserSecretAndRoutine(userId);
|
||||
let valid = speakeasy.totp.verify({
|
||||
secret: secret,
|
||||
encoding: "base32",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue