Make the user store handle data stores

This commit is contained in:
Bubka
2023-10-27 15:42:58 +02:00
parent a52cc2dcc9
commit 46a58ecb29
3 changed files with 49 additions and 5 deletions

View File

@ -8,13 +8,12 @@ export default async function auth({ to, next, stores }) {
if (! user.isAuthenticated) {
const currentUser = await authService.getCurrentUser()
if (currentUser) {
user.$patch({
user.loginAs({
name: currentUser.name,
email: currentUser.email,
preferences: currentUser.preferences,
isAdmin: currentUser.is_admin,
})
user.applyUserPrefs()
}
}