migration change on default value and encrypted storage

This commit is contained in:
Julian Krauser 2025-05-04 19:01:06 +02:00
parent 03a5bb3592
commit a476bf6823
11 changed files with 82 additions and 36 deletions

View file

@ -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",