fix(api): harden optional audit and session fields

This commit is contained in:
2026-03-31 22:54:33 +02:00
parent 160ba99b5c
commit 8bc764a35e
4 changed files with 47 additions and 4 deletions
@@ -157,7 +157,7 @@ export async function generateTotpSecret(ctx: UserSelfServiceContext) {
const secret = new Secret({ size: 20 });
const totp = new TOTP({
issuer: "CapaKraken",
label: ctx.session.user?.email ?? ctx.dbUser!.id,
label: ctx.session?.user?.email ?? ctx.dbUser!.id,
algorithm: "SHA1",
digits: 6,
period: 30,