mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-16 08:37:53 +02:00
Make the user store handle data stores
This commit is contained in:
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user