20260721173401
This commit is contained in:
1 parent
fd161dd302
commit
bab8e2972f
32 files changed
+1207
-3171
No files matched your search
@@ -1,9 +1,14 @@
|
||||
import { computed, ref } from "vue";
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
const AUTH_STORAGE_KEY = "fms-auth";
|
||||
|
||||
try {
|
||||
// Remove sessions persisted by earlier versions; authentication is session-only now.
|
||||
localStorage.removeItem("fms-auth");
|
||||
// Retain a session created before persistence moved from sessionStorage.
|
||||
const session = sessionStorage.getItem(AUTH_STORAGE_KEY);
|
||||
if (session && !localStorage.getItem(AUTH_STORAGE_KEY)) {
|
||||
localStorage.setItem(AUTH_STORAGE_KEY, session);
|
||||
}
|
||||
} catch {
|
||||
// Storage can be unavailable in restricted browser contexts.
|
||||
}
|
||||
@@ -39,8 +44,8 @@ export const useAuthStore = defineStore(
|
||||
},
|
||||
{
|
||||
persist: {
|
||||
key: "fms-auth",
|
||||
storage: sessionStorage,
|
||||
key: AUTH_STORAGE_KEY,
|
||||
storage: localStorage,
|
||||
pick: ["token", "orgId", "user"],
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { computed, ref } from "vue";
|
||||
import { defineStore } from "pinia";
|
||||
import { loadDataApi } from "../services/api";
|
||||
import { loadDataApi } from "@/services/api";
|
||||
import { useAuthStore } from "./auth";
|
||||
|
||||
export const usePermissionStore = defineStore("permissions", () => {
|
||||
|
||||
Reference in new issue
Block a user