Skip to content
Snippets Groups Projects
Unverified Commit 77e42102 authored by nexryai's avatar nexryai Committed by GitHub
Browse files

Merge commit from fork

* fix(frontend): Improve cookie attributes

* fix(frontend): Delete an old authentication cookie in fetchAccount
parent f8f17a44
No related branches found
No related tags found
No related merge requests found
......@@ -101,6 +101,9 @@ export async function removeAccount(idOrToken: Account['id']) {
}
function fetchAccount(token: string, id?: string, forceShowDialog?: boolean): Promise<Account> {
document.cookie = "token=; path=/; max-age=0";
document.cookie = `token=${token}; path=/queue; max-age=86400; SameSite=Strict; Secure`; // bull dashboardの認証とかで使う
return new Promise((done, fail) => {
window.fetch(`${apiUrl}/i`, {
method: 'POST',
......@@ -213,7 +216,6 @@ export async function login(token: Account['token'], redirect?: string) {
throw reason;
});
miLocalStorage.setItem('account', JSON.stringify(me));
document.cookie = `token=${token}; path=/; max-age=31536000`; // bull dashboardの認証とかで使う
await addAccount(me.id, token);
if (redirect) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment