diff --git a/src/routes/login/index.tsx b/src/routes/login/index.tsx index 1c980fe..bbae566 100644 --- a/src/routes/login/index.tsx +++ b/src/routes/login/index.tsx @@ -552,7 +552,54 @@ export default function LoginPage() { Login Success! Redirecting... + {/* Code Input Section */} + +
+

+ Enter Your Code +

+

+ Check your email for a 6-digit code +

+

+ Code expires in{" "} + {expiryToHuman(AUTH_CONFIG.EMAIL_LOGIN_LINK_EXPIRY)} +

+
+
+ + setLoginCode( + e.currentTarget.value.replace(/\D/g, "").slice(0, 6) + ) + } + placeholder="000000" + maxLength={6} + class="text-blue mx-auto block w-48 rounded-lg border border-zinc-300 bg-white px-4 py-3 text-center text-2xl font-bold tracking-widest dark:border-zinc-600 dark:bg-zinc-900" + autocomplete="off" + /> +
+ + +
+ {codeError()} +
+
+ + +
+
+
Email Sent!
- {/* Code Input Section */} - -
-

- Enter Your Code -

-

- Check your email for a 6-digit code -

-

- Code expires in{" "} - {expiryToHuman(AUTH_CONFIG.EMAIL_LOGIN_LINK_EXPIRY)} -

- -
-
- - setLoginCode( - e.currentTarget.value.replace(/\D/g, "").slice(0, 6) - ) - } - placeholder="000000" - maxLength={6} - class="text-blue mx-auto block w-48 rounded-lg border border-zinc-300 bg-white px-4 py-3 text-center text-2xl font-bold tracking-widest dark:border-zinc-600 dark:bg-zinc-900" - autocomplete="off" - /> -
- - -
{codeError()}
-
- - -
-
-
-
Or
diff --git a/src/server/session-config.ts b/src/server/session-config.ts index 58ac65e..7d4d058 100644 --- a/src/server/session-config.ts +++ b/src/server/session-config.ts @@ -27,13 +27,12 @@ export interface SessionData { */ export const sessionConfig: SessionConfig = { password: env.JWT_SECRET_KEY, - cookieName: "session", - cookieOptions: { + name: "session", + cookie: { httpOnly: true, secure: env.NODE_ENV === "production", sameSite: "strict", path: "/" - // maxAge is set dynamically based on rememberMe } }; @@ -43,7 +42,7 @@ export const sessionConfig: SessionConfig = { */ export function getSessionCookieOptions(rememberMe: boolean) { return { - ...sessionConfig.cookieOptions, + ...sessionConfig.cookie, maxAge: rememberMe ? expiryToSeconds(AUTH_CONFIG.REFRESH_TOKEN_EXPIRY_LONG) : undefined // Session cookie (expires on browser close)