Better UX for profile view logout buttons.
This commit is contained in:
1 parent
01bc39a0e8
commit
eaa16abe2a
3 files changed
+25
-7
No files matched your search
@@ -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