Skip to content

Commit f75e6aa

Browse files
committed
conflicts resolved
2 parents f0f7a1a + f950b57 commit f75e6aa

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

LearningHub.Nhs.UserApi.Services/ElfhUserService.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,21 +230,22 @@ public async Task RecordSuccessfulSigninAsync(int id, CancellationToken token =
230230
{
231231
var user = await this.lhUserRepository.GetByIdAsync(id);
232232

233-
user.LoginTimes++;
234-
user.PasswordLifeCounter = 0;
235-
user.SecurityLifeCounter = 0;
233+
if (user.PasswordLifeCounter != 0 || user.SecurityLifeCounter != 0)
234+
{
235+
user.PasswordLifeCounter = 0;
236+
user.SecurityLifeCounter = 0;
236237

237238
await this.lhUserRepository.UpdateAsync(id, user);
238239

239-
await this.InvalidateElfhUserCacheAsync(user.Id, user.UserName, token);
240+
await this.InvalidateElfhUserCacheAsync(user.Id, user.UserName, token);
241+
}
240242
}
241243

242244
/// <inheritdoc/>
243245
public async Task RecordUnsuccessfulSigninAsync(int id, CancellationToken token = default)
244246
{
245247
var user = await this.lhUserRepository.GetByIdAsync(id);
246248

247-
user.LoginTimes++;
248249
user.PasswordLifeCounter++;
249250

250251
await this.lhUserRepository.UpdateAsync(id, user);

0 commit comments

Comments
 (0)