import { defineStore } from 'pinia' export const useAuthStore = defineStore('auth', { state: () => ({ tokens: {}, }), actions: { setToken(publicKey, token) { this.tokens[publicKey] = token localStorage.setItem(publicKey, token) }, clearToken(publicKey) { this.tokens[publicKey] = null localStorage.removeItem(publicKey) }, loadTokenFromStorage(publicKey) { const token = localStorage.getItem(publicKey) if (token) this.tokens[publicKey] = token } }, })