Add new frontend - fix 5

This commit is contained in:
Urtzi Alfaro
2025-07-22 10:17:41 +02:00
parent 52232815a2
commit 915be54349
5 changed files with 4 additions and 17 deletions

View File

@@ -57,7 +57,8 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
const register = useCallback(async (data: any) => {
const profile = await authService.register(data);
setUser(profile);
}, []);
await login(data.email, data.password); // Reuse the login function
}, [login]);
const logout = useCallback(async () => {
await authService.logout();