Skip to content

Commit 304a687

Browse files
committed
Refactor frontend error management
Also move login/logout logic to their own component, instead of the AuthStore
1 parent 4d38092 commit 304a687

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/assets/components/NavBar.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<script setup>
2+
import { useLogoutApi } from '@userfrosting/sprinkle-account/composables'
23
import { useAuthStore } from '@userfrosting/sprinkle-account/stores'
34
import { useConfigStore } from '@userfrosting/sprinkle-core/stores'
45
const config = useConfigStore()
56
6-
// Logout API variables
7+
// Auth and Logout API variables
78
const auth = useAuthStore()
9+
const { submitLogout } = useLogoutApi()
810
</script>
911

1012
<template>
@@ -28,7 +30,7 @@ const auth = useAuthStore()
2830
:label="$t('ACCOUNT.SETTINGS')"
2931
v-if="$checkAccess('update_account_settings')"
3032
:to="{ name: 'account.settings' }" />
31-
<UFNavBarUserCardButton :label="$t('LOGOUT')" @click="auth.logout()" />
33+
<UFNavBarUserCardButton :label="$t('LOGOUT')" @click="submitLogout()" />
3234
</UFNavBarUserCard>
3335
</UFNavBar>
3436
</template>

0 commit comments

Comments
 (0)