fix(audit): P2 frontend any→concrete types (181→61), heroicons→lucide-react, missing type exports, toast API, Select options, TaskStatus types; P2-9 hooks.py type annotations
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
* Authentication hooks: login, logout, current user, password reset, tenant switching.
|
||||
*/
|
||||
|
||||
import { asError } from '@/utils/errorTypes';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { apiPost, apiGet, setCsrfToken } from './client';
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
@@ -44,8 +45,8 @@ export function useLogin() {
|
||||
setCsrfToken(data.csrf_token);
|
||||
}
|
||||
},
|
||||
onError: (error: any) => {
|
||||
setError(error.message || 'Login failed');
|
||||
onError: (error: unknown) => { const errObj = asError(error);
|
||||
setError(errObj.message || 'Login failed');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user