Skip to content

Commit

Permalink
fix: remove setUserCookie function
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriassuncx authored Oct 11, 2024
1 parent d03ee0b commit 9d0abd1
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions vnda/utils/user.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
import { getCookies, setCookie } from "std/http/cookie.ts";
import { getCookies } from "std/http/cookie.ts";

const AUTH_COOKIE = "client_id";

const ONE_WEEK_MS = 7 * 24 * 3600 * 1_000;

export const getUserCookie = (headers: Headers): string | undefined => {
const cookies = getCookies(headers);

return cookies[AUTH_COOKIE];
};

export const setUserCookie = (headers: Headers, accessToken: string) => {
setCookie(headers, {
name: AUTH_COOKIE,
value: accessToken,
path: "/",
expires: new Date(Date.now() + ONE_WEEK_MS),
httpOnly: true,
secure: true,
sameSite: "Lax",
});
};

0 comments on commit 9d0abd1

Please sign in to comment.