Feat Varios 3
This commit is contained in:
@@ -46,7 +46,7 @@ public class AuthService : IAuthService
|
||||
// Si MFA está activo, no devolver token aún, pedir verificación
|
||||
if (user.IsMfaEnabled)
|
||||
{
|
||||
return new AuthResult { Success = true, RequiresMfa = true };
|
||||
return new AuthResult { Success = true, RequiresMfa = true, UserId = user.Id };
|
||||
}
|
||||
|
||||
// Éxito: Reiniciar intentos y generar token
|
||||
@@ -59,7 +59,8 @@ public class AuthService : IAuthService
|
||||
{
|
||||
Success = true,
|
||||
Token = _tokenService.GenerateToken(user),
|
||||
RequiresPasswordChange = user.MustChangePassword
|
||||
RequiresPasswordChange = user.MustChangePassword,
|
||||
UserId = user.Id
|
||||
};
|
||||
}
|
||||
|
||||
@@ -83,7 +84,7 @@ public class AuthService : IAuthService
|
||||
};
|
||||
|
||||
await _userRepo.CreateAsync(user);
|
||||
return new AuthResult { Success = true, Token = _tokenService.GenerateToken(user) };
|
||||
return new AuthResult { Success = true, Token = _tokenService.GenerateToken(user), UserId = user.Id };
|
||||
}
|
||||
|
||||
// Login mediante Google OAuth
|
||||
@@ -117,9 +118,9 @@ public class AuthService : IAuthService
|
||||
await _userRepo.UpdateAsync(user);
|
||||
}
|
||||
|
||||
if (user.IsMfaEnabled) return new AuthResult { Success = true, RequiresMfa = true };
|
||||
if (user.IsMfaEnabled) return new AuthResult { Success = true, RequiresMfa = true, UserId = user.Id };
|
||||
|
||||
return new AuthResult { Success = true, Token = _tokenService.GenerateToken(user) };
|
||||
return new AuthResult { Success = true, Token = _tokenService.GenerateToken(user), UserId = user.Id };
|
||||
}
|
||||
catch (InvalidJwtException)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user