Implement authentication logic
This commit is contained in:
parent
0398acf2b7
commit
cb3a151748
11 changed files with 196 additions and 24 deletions
|
@ -1,23 +0,0 @@
|
|||
import { writable } from 'svelte/store'
|
||||
|
||||
interface PersistedSettings {
|
||||
darkmode: boolean
|
||||
loggedIn: boolean
|
||||
friendlyName: string
|
||||
email: string
|
||||
role: string
|
||||
refreshToken: string
|
||||
}
|
||||
|
||||
const settingsDefault: PersistedSettings = {
|
||||
darkmode: false,
|
||||
loggedIn: false,
|
||||
friendlyName: "",
|
||||
email: "",
|
||||
role: "member",
|
||||
refreshToken: ""
|
||||
}
|
||||
|
||||
export const persistentSettings = writable<PersistedSettings>(JSON.parse(localStorage.getItem('persistentSettings') || JSON.stringify(settingsDefault)))
|
||||
|
||||
persistentSettings.subscribe((value) => localStorage.persistentSettings = JSON.stringify(value))
|
Loading…
Add table
Add a link
Reference in a new issue