fix login
This commit is contained in:
+7
-14
@@ -40,28 +40,21 @@ export const getRefreshToken = () => {
|
||||
return Cookie.get(import.meta.env.VITE_REFRESH_TOKEN_NAME);
|
||||
};
|
||||
|
||||
const isProduction = import.meta.env.MODE === "production";
|
||||
const domain = isProduction ? ".danakcorp.com" : undefined;
|
||||
|
||||
export const setToken = (token: string) => {
|
||||
Cookie.set(import.meta.env.VITE_TOKEN_NAME, token, {
|
||||
domain: ".danakcorp.com",
|
||||
});
|
||||
Cookie.set(import.meta.env.VITE_TOKEN_NAME, token, { domain });
|
||||
};
|
||||
|
||||
export const setRefreshToken = (refreshToken: string) => {
|
||||
Cookie.set(import.meta.env.VITE_REFRESH_TOKEN_NAME, refreshToken, {
|
||||
domain: ".danakcorp.com",
|
||||
});
|
||||
Cookie.set(import.meta.env.VITE_REFRESH_TOKEN_NAME, refreshToken, { domain });
|
||||
};
|
||||
|
||||
export const removeToken = () => {
|
||||
Cookie.remove(import.meta.env.VITE_TOKEN_NAME, {
|
||||
domain: ".danakcorp.com",
|
||||
path: "/",
|
||||
});
|
||||
Cookie.remove(import.meta.env.VITE_TOKEN_NAME, { domain, path: "/" });
|
||||
};
|
||||
|
||||
export const removeRefreshToken = () => {
|
||||
Cookie.remove(import.meta.env.VITE_REFRESH_TOKEN_NAME, {
|
||||
domain: ".danakcorp.com",
|
||||
path: "/",
|
||||
});
|
||||
Cookie.remove(import.meta.env.VITE_REFRESH_TOKEN_NAME, { domain, path: "/" });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user