feat: support change-password and admin must_change_password

This commit is contained in:
2026-06-12 22:41:25 +02:00 Unverified
parent fac34e5f91
commit 1d8ad90151
3 changed files with 196 additions and 1 deletions
+8
View File
@@ -35,6 +35,14 @@ export const useAuth = () => {
if (res.ok) {
console.log('[Auth] User synced successfully')
user.value = res.user
const route = useRoute()
if (res.user.must_change_password && route.path !== '/auth/change-password') {
console.log('[Auth] User must change password, redirecting...')
await navigateTo('/auth/change-password')
} else {
await navigateTo('/dashboard')
}
}
} catch (error) {
console.error('[Auth] Sync failed, logging out:', error)