Better UX for profile view logout buttons.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { register, authenticate } from '@/utils/passkey'
|
||||
import { getSettings } from '@/utils/settings'
|
||||
|
||||
export const useAuthStore = defineStore('auth', {
|
||||
state: () => ({
|
||||
@@ -7,6 +8,9 @@ export const useAuthStore = defineStore('auth', {
|
||||
userInfo: null, // Contains the full user info response: {user, credentials, aaguid_info}
|
||||
isLoading: false,
|
||||
|
||||
// Settings
|
||||
settings: null,
|
||||
|
||||
// UI State
|
||||
currentView: 'login',
|
||||
status: {
|
||||
@@ -74,6 +78,9 @@ export const useAuthStore = defineStore('auth', {
|
||||
if (!this.userInfo) this.currentView = 'login'
|
||||
else this.currentView = 'profile'
|
||||
},
|
||||
async loadSettings() {
|
||||
this.settings = await getSettings()
|
||||
},
|
||||
async loadUserInfo() {
|
||||
const response = await fetch('/auth/api/user-info', { method: 'POST' })
|
||||
let result = null
|
||||
|
||||
Reference in New Issue
Block a user