refactor: modularize frontend flows
This commit is contained in:
1 parent
9300607f96
commit
a11e7900b4
85 files changed
+4654
-4363
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { STORAGE_KEYS } from '@/constants'
|
||||
|
||||
export function readStoredAdminPassword(): string {
|
||||
return localStorage.getItem(STORAGE_KEYS.ADMIN_PASSWORD) || ''
|
||||
}
|
||||
|
||||
export function writeStoredAdminPassword(password: string) {
|
||||
localStorage.setItem(STORAGE_KEYS.ADMIN_PASSWORD, password)
|
||||
}
|
||||
|
||||
export function readStoredToken(): string {
|
||||
return localStorage.getItem(STORAGE_KEYS.TOKEN) || ''
|
||||
}
|
||||
|
||||
export function writeStoredToken(token: string) {
|
||||
localStorage.setItem(STORAGE_KEYS.TOKEN, token)
|
||||
}
|
||||
|
||||
export function clearStoredAuth() {
|
||||
localStorage.removeItem(STORAGE_KEYS.ADMIN_PASSWORD)
|
||||
localStorage.removeItem(STORAGE_KEYS.TOKEN)
|
||||
}
|
||||
|
||||
export function clearStoredToken() {
|
||||
localStorage.removeItem(STORAGE_KEYS.TOKEN)
|
||||
}
|
||||
Reference in new issue
Block a user