Skip to content

Commit

Permalink
save new user token when silently refreshing token
Browse files Browse the repository at this point in the history
  • Loading branch information
ulfgebhardt committed Apr 11, 2024
1 parent cc36336 commit eefb025
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/src/pages/silent-refresh/+Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ import { inject, onBeforeMount } from 'vue'
import DefaultLayout from '#layouts/DefaultLayout.vue'
import AuthService from '#src/services/AuthService'
import { useAuthStore } from '#stores/authStore.js'
const authService = inject<AuthService>('authService')
const auth = useAuthStore()
onBeforeMount(async () => {
try {
await authService?.renewToken()
auth.save((await authService?.getUser()) || null)
navigate('/')
} catch (error) {
// eslint-disable-next-line no-console
Expand Down

0 comments on commit eefb025

Please sign in to comment.