🧱 Try to fix cookies issues

This commit is contained in:
ajnart
2022-06-07 19:34:58 +02:00
parent fb291c5411
commit 84ae49ed2a
3 changed files with 6 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ export default function ConfigChanger() {
label="Config loader" label="Config loader"
onChange={(e) => { onChange={(e) => {
loadConfig(e ?? 'default'); loadConfig(e ?? 'default');
setCookies('config-name', e ?? 'default', { maxAge: 60 * 60 * 24 * 30 }); setCookies('config-name', e ?? 'default', { maxAge: 60 * 60 * 24 * 30, sameSite: 'strict' });
}} }}
data={ data={
// If config list is empty, return the current config // If config list is empty, return the current config

View File

@@ -90,7 +90,10 @@ export default function LoadConfigComponent(props: any) {
icon: <Check />, icon: <Check />,
message: undefined, message: undefined,
}); });
setCookies('config-name', newConfig.name, { maxAge: 60 * 60 * 24 * 30 }); setCookies('config-name', newConfig.name, {
maxAge: 60 * 60 * 24 * 30,
sameSite: 'strict',
});
const migratedConfig = migrateToIdConfig(newConfig); const migratedConfig = migrateToIdConfig(newConfig);
setConfig(migratedConfig); setConfig(migratedConfig);
}); });

View File

@@ -43,7 +43,7 @@ export default function AuthenticationTitle() {
onSubmit={form.onSubmit((values) => { onSubmit={form.onSubmit((values) => {
setCookies('password', values.password, { setCookies('password', values.password, {
maxAge: 60 * 60 * 24 * 30, maxAge: 60 * 60 * 24 * 30,
sameSite: 'strict', sameSite: 'lax',
}); });
showNotification({ showNotification({
id: 'load-data', id: 'load-data',