feat(otp): use dedicated method to get user's otp secret

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Maix0 2025-08-31 16:36:47 +02:00
parent 238dead666
commit 4f8ebc7dd9

View file

@ -40,7 +40,7 @@ const route: FastifyPluginAsync = async (fastify, _opts): Promise<void> => {
return makeResponse("failed", "otp.failed.timeout"); return makeResponse("failed", "otp.failed.timeout");
// get the Otp sercret from the db // get the Otp sercret from the db
let otpSecret = this.db.getUserFromName(dJwt.who)?.otp; let otpSecret = this.db.getUserOtpSecret(dJwt.who);
if (isNullish(otpSecret)) if (isNullish(otpSecret))
// oops, either no user, or user without otpSecret // oops, either no user, or user without otpSecret
// fuck off // fuck off