aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Services/User/UserService.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-04-28 16:55:37 +0800
committercrupest <crupest@outlook.com>2021-04-28 16:55:37 +0800
commit344d189e5860a20ebe42cec03b86974a2a3aaa95 (patch)
treec3958d2ea965c0f31a498501ffe6ab77ed8e35ad /BackEnd/Timeline/Services/User/UserService.cs
parentd4d0836279f83bbd3d0f47873cd1e182e4459e65 (diff)
downloadtimeline-344d189e5860a20ebe42cec03b86974a2a3aaa95.tar.gz
timeline-344d189e5860a20ebe42cec03b86974a2a3aaa95.tar.bz2
timeline-344d189e5860a20ebe42cec03b86974a2a3aaa95.zip
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Services/User/UserService.cs')
-rw-r--r--BackEnd/Timeline/Services/User/UserService.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Services/User/UserService.cs b/BackEnd/Timeline/Services/User/UserService.cs
index 6496b55b..443afb90 100644
--- a/BackEnd/Timeline/Services/User/UserService.cs
+++ b/BackEnd/Timeline/Services/User/UserService.cs
@@ -178,10 +178,16 @@ namespace Timeline.Services.User
var entity = await _databaseContext.Users.Where(u => u.Username == username).Select(u => new { u.Id, u.Password }).SingleOrDefaultAsync();
if (entity is null)
+ {
+ _logger.LogInformation(Resource.LogVerifyCredentialsUsernameBad, username);
throw new UserNotExistException(username);
+ }
if (!_passwordService.VerifyPassword(entity.Password, password))
+ {
+ _logger.LogInformation(Resource.LogVerifyCredentialsPasswordBad, username);
throw new BadPasswordException(password);
+ }
return entity.Id;
}