Add Secure and SameSite=Lax flags to all cookie operations
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import pinia from '@/stores/main.ts';
|
||||
import {useToast} from 'vue-toast-notification';
|
||||
import 'vue-toast-notification/dist/theme-sugar.css';
|
||||
import axios from "axios";
|
||||
import { deleteCookie } from "@/utils/cookieUtil.js";
|
||||
|
||||
const loading = loadingStore(pinia);
|
||||
const $toast = useToast();
|
||||
@@ -19,7 +20,7 @@ const delay = (s = 0) => new Promise((resolve, reject) => setTimeout(resolve, s
|
||||
export default async function apiError(error, toastMessage) {
|
||||
if(error.request?.status === 401) {
|
||||
delete axios.defaults.headers.common["Authorization"];
|
||||
document.cookie = 'luciaToken=; expires=Thu, 01 Jan 1970 00:00:00 UTC;';
|
||||
deleteCookie("luciaToken");
|
||||
return router.push('/login');
|
||||
}
|
||||
await delay();
|
||||
|
||||
Reference in New Issue
Block a user