Allowed secure httpOnly cookies

This commit is contained in:
Luke Hagar
2024-03-11 11:07:57 -05:00
parent 0f117d2daa
commit fe68bd4584
3 changed files with 10 additions and 18 deletions

View File

@@ -76,9 +76,7 @@ export function getTokenDetails(cookies: Cookies): TokenDetails | undefined {
export function setTokenDetails(cookies: Cookies, tokenDetails: TokenDetails) {
cookies.set('tokenDetails', encrypt(JSON.stringify(tokenDetails)), {
path: '/',
httpOnly: false,
secure: false
path: '/'
});
}
@@ -120,15 +118,11 @@ export async function refreshToken(
export async function logout(cookies: Cookies) {
cookies.delete('session', {
path: '/',
httpOnly: false,
secure: false
path: '/'
});
cookies.delete('idnSession', {
path: '/',
httpOnly: false,
secure: false
path: '/'
});
}

View File

@@ -36,9 +36,7 @@ export const load: PageServerLoad = async ({ url, cookies, locals }) => {
});
cookies.set('idnSession', encrypt(JSON.stringify(response.data)), {
path: '/',
httpOnly: false,
secure: false
path: '/'
});
return { counterList };

View File

@@ -2,15 +2,15 @@ import { generateLogoutLink } from '$lib/utils/oauth.js';
export const load = async ({ cookies, locals }) => {
cookies.delete('session', {
path: '/',
httpOnly: false,
secure: false
path: '/'
});
cookies.delete('idnSession', {
path: '/',
httpOnly: false,
secure: false
path: '/'
});
cookies.delete('tokenDetails', {
path: '/'
});
console.log('Logging out');