Skip to content

Commit

Permalink
hardcode cookie opt
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansmrd committed Aug 4, 2024
1 parent cabf45e commit cf51f40
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const NEXT_PUBLIC_BASE_API_URL = process.env.NEXT_PUBLIC_BASE_API_URL;
export const cookiesOpt: Partial<ResponseCookie> = {
sameSite: "strict",
secure: true,
domain: process.env.NEXT_PUBLIC_COOKIE_DOMAIN,
domain: "purwadhikabootcamp.com",
};
13 changes: 11 additions & 2 deletions apps/web/src/utils/token.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import { cookiesOpt } from "@/config/config";
import { deleteCookie } from "cookies-next";

export function deleteClientTokens() {
deleteCookie("access_token");
deleteCookie("refresh_token");
deleteCookie("access_token", {
domain: "purwadhikabootcamp.com",
sameSite: "strict",
secure: true,
});
deleteCookie("refresh_token", {
domain: "purwadhikabootcamp.com",
sameSite: "strict",
secure: true,
});
}

0 comments on commit cf51f40

Please sign in to comment.