Skip to content
Snippets Groups Projects
Commit 94aed953 authored by dakkar's avatar dakkar
Browse files

merge: make cookie a bit more secure - fixes #445 (!468)

View MR for information: !468



Closes #445

Approved-by: Luna's avatarLuna <her@mint.lgbt>
Approved-by: default avatarAmelia Yukii <amelia.yukii@shourai.de>
parents aa7035a3 6826e43a
No related branches found
No related tags found
3 merge requests!485release 2024.3.2,!479more merges from misskey,!468make cookie a bit more secure - fixes #445
Pipeline #411 passed with stages
in 20 minutes and 23 seconds
......@@ -43,6 +43,7 @@ export async function signout() {
waiting();
miLocalStorage.removeItem('account');
await removeAccount($i.id);
document.cookie = `token=; path=/; max-age=0${ location.protocol === 'https:' ? '; Secure' : ''}`;
const accounts = await getAccounts();
//#region Remove service worker registration
......@@ -200,7 +201,7 @@ 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の認証とかで使う
document.cookie = `token=${token}; path=/; max-age=31536000${ location.protocol === 'https:' ? '; Secure' : ''}`; // 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