Add new frontend - fix 13

This commit is contained in:
Urtzi Alfaro
2025-07-22 20:22:27 +02:00
parent 5dffe39706
commit dd05f3a0f5
5 changed files with 21 additions and 7 deletions

View File

@@ -97,7 +97,11 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
const register = useCallback(async (data: RegisterRequest) => {
setIsLoading(true);
try {
const profile = await authService.register(data);
// Register and store tokens (like login)
const tokenResponse = await authService.register(data);
// After registration, get user profile
const profile = await api.auth.getCurrentUser();
setUser(profile);
} catch (error) {
setIsLoading(false);