mirror of
https://github.com/wireadmin/wireadmin
synced 2025-03-09 21:30:14 +00:00
fix cookie on remote
This commit is contained in:
parent
1f189a710e
commit
771a0f301c
@ -38,7 +38,22 @@ export const actions: Actions = {
|
||||
}
|
||||
|
||||
const token = await generateToken();
|
||||
|
||||
const { ORIGIN } = process.env;
|
||||
if (ORIGIN) {
|
||||
console.log('[+] TEST ONLY', 'ORIGIN', ORIGIN);
|
||||
|
||||
const secure = ORIGIN.startsWith('https://');
|
||||
event.cookies.set('authorization', token, {
|
||||
secure,
|
||||
httpOnly: true,
|
||||
path: '/'
|
||||
});
|
||||
|
||||
} else {
|
||||
event.cookies.set('authorization', token);
|
||||
}
|
||||
|
||||
|
||||
return { ok: true };
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user