Skip to content

Commit

Permalink
ef data update fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tinohager committed Jun 14, 2024
1 parent 41a6592 commit a6477f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Nager.Authentication/Nager.Authentication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Nullable>enable</Nullable>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>

<Version>2.0.1</Version>
<Version>2.0.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
9 changes: 7 additions & 2 deletions src/Nager.Authentication/Services/UserAccountService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,14 @@ public async Task<MfaDeactivationResult> DeactivateMfaAsync(
};
}

if (!await this.CreateMfaSecretAsync(emailAddress, cancellationToken))
if (userEntity.MfaSecret == null)
{
return null;
if (!await this.CreateMfaSecretAsync(emailAddress, cancellationToken))
{
return null;
}

userEntity = await this._userRepository.GetAsync(o => o.EmailAddress.Equals(emailAddress), cancellationToken);
}

var twoFactorAuthenticator = new TwoFactorAuthenticator();
Expand Down

0 comments on commit a6477f3

Please sign in to comment.