Added libs

This commit is contained in:
Lucas
2026-01-25 13:55:46 +10:00
parent 575c682afc
commit f70af3c4ea
229 changed files with 26983 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
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
}
},
})