push
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user