added two factor to login endpoint

This commit is contained in:
Milo Schwartz 2024-10-02 20:19:48 -04:00
parent d7e090e5b7
commit d1e198fe55
No known key found for this signature in database
5 changed files with 308 additions and 6 deletions

View file

@ -10,6 +10,8 @@ export const lucia = new Lucia(adapter, {
getUserAttributes: (attributes) => {
return {
email: attributes.email,
twoFactorEnabled: attributes.twoFactorEnabled,
twoFactorSecret: attributes.twoFactorSecret,
};
},
// getSessionAttributes: (attributes) => {
@ -42,6 +44,8 @@ declare module "lucia" {
interface DatabaseUserAttributes {
email: string;
passwordHash: string;
twoFactorEnabled: boolean;
twoFactorSecret: string | null;
}
interface DatabaseSessionAttributes {