Skip to content

Commit

Permalink
Fix bring logged out every few hours
Browse files Browse the repository at this point in the history
The session cookie expiry was set in seconds instead of ms
  • Loading branch information
jakst committed Dec 23, 2024
1 parent 5e92e02 commit 96ac2c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/app/src/lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const login = action(async (formData: FormData) => {
if (`${username}:${password}` !== secretEnv.AUTH_INFO) return new Error("Invalid credentials")

setCookie("authenticated", "true", {
expires: new Date(Date.now() + 60 * 60 * 24 * 365),
expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365),
httpOnly: true,
sameSite: "lax",
secure: getRequestProtocol() === "https",
Expand Down

0 comments on commit 96ac2c6

Please sign in to comment.