Better UX for profile view logout buttons.

This commit is contained in:
2025-10-05 04:22:16 +00:00
parent 01bc39a0e8
commit eaa16abe2a
3 changed files with 25 additions and 7 deletions
+7
View File
@@ -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