This commit is contained in:
Timo Knuth
2026-02-27 15:19:24 +01:00
parent b7f8221095
commit 253c3c1c6d
134 changed files with 11188 additions and 1871 deletions

View File

@@ -3,7 +3,7 @@ import { authClient } from '@/lib/auth-client'
import AsyncStorage from '@react-native-async-storage/async-storage'
interface Session {
user: { id: string; email: string; name: string }
user: { id: string; email: string; name: string; mustChangePassword?: boolean }
}
interface AuthState {
@@ -29,8 +29,16 @@ export const useAuthStore = create<AuthState>((set) => ({
// authClient now sends the token via cookie header (see auth-client.ts)
const result = await authClient.getSession()
if (result?.data?.user) {
const u = result.data.user as any
set({
session: { user: result.data.user },
session: {
user: {
id: u.id,
email: u.email,
name: u.name,
mustChangePassword: u.mustChangePassword ?? false,
},
},
isInitialized: true,
})
} else {