Wire frontend login to user_login.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alberto-AudrixandCursor committed 2026-09-08 16:23:05 +07:00
1 parent 4eed6b2e87
commit 92be5ee3d2
4 files changed
+16 -14

No files matched your search

+3 -3
View File
@@ -5,7 +5,7 @@ import type { User } from '../types/api.ts';
type AuthContextValue = {
user: User | null;
loading: boolean;
login: (userName: string, password: string) => Promise<void>;
login: (userLogin: string, password: string) => Promise<void>;
logout: () => Promise<void>;
refreshUser: () => Promise<User | null>;
};
@@ -45,9 +45,9 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
};
}, []);
const login = useCallback(async (userName: string, password: string) => {
const login = useCallback(async (userLogin: string, password: string) => {
await api.auth.csrf();
const next = await api.auth.login(userName, password);
const next = await api.auth.login(userLogin, password);
setUser(next);
}, []);