mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-24 23:39:37 +02:00
Update secure cookie setting to conditionally use HTTPS protocol in authentication flows
This commit is contained in:
parent
8716efb613
commit
b5ac66a1cc
3 changed files with 3 additions and 3 deletions
|
@ -47,7 +47,7 @@ export const authHook: Handle = async ({ event, resolve }) => {
|
|||
path: '/',
|
||||
httpOnly: true,
|
||||
sameSite: 'lax',
|
||||
secure: true,
|
||||
secure: event.url.protocol === 'https:',
|
||||
expires: expiryDate
|
||||
});
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ function handleSuccessfulLogin(event: RequestEvent<RouteParams, '/login'>, respo
|
|||
path: '/',
|
||||
httpOnly: true,
|
||||
sameSite: 'lax',
|
||||
secure: true,
|
||||
secure: event.url.protocol === 'https:',
|
||||
expires: new Date(expiryString)
|
||||
});
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ export const actions: Actions = {
|
|||
path: '/',
|
||||
httpOnly: true,
|
||||
sameSite: 'lax',
|
||||
secure: true,
|
||||
secure: event.url.protocol === 'https:',
|
||||
expires: expiryDate
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue