Fix changes #70

Merged
DeepnaPooja merged 38 commits from fix-changes into dev 2026-10-19 16:45:55 +05:30
Showing only changes of commit 2fe2ba007c - Show all commits
+3 -3
View File
@@ -80,9 +80,9 @@ export function AuthProvider({ children }: { children: ReactNode }) {
}, [router])
async function login(identifier: string, password: string) {
const { data: res } = await api.post<{ statusCode: number; success: boolean; message: string; data: { profile: User } | null }>('/auth/login', { identifier, password, deviceName: 'Web' })
if (!res.data) throw new Error(res.message ?? 'Invalid credentials')
setUser(res.data.profile)
const { data: res } = await api.post<{ statusCode: number; success: boolean; message: string; data: unknown | null; profile: User | null }>('/auth/login', { identifier, password, deviceName: 'Web' })
if (!res.profile) throw new Error(res.message ?? 'Invalid credentials')
setUser(res.profile)
try {
const { data: permData } = await api.get<{ permissions: string[] }>('/authorization/my-permissions')
savePermissions(permData.permissions)