Skip to content

Commit

Permalink
[PM-4167] chore: improve readability of GetPrfStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
coroiu committed Nov 6, 2023
1 parent 5e589ae commit ee3fad2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Core/Auth/Entities/WebAuthnCredential.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ public void SetNewId()

public WebAuthnPrfStatus GetPrfStatus()
{
if (SupportsPrf && EncryptedUserKey != null && EncryptedPrivateKey != null && EncryptedPublicKey != null)
if (!SupportsPrf)
{
return WebAuthnPrfStatus.Enabled;
return WebAuthnPrfStatus.Unsupported;
}
else if (SupportsPrf)

if (EncryptedUserKey != null && EncryptedPrivateKey != null && EncryptedPublicKey != null)
{
return WebAuthnPrfStatus.Supported;
return WebAuthnPrfStatus.Enabled;
}

return WebAuthnPrfStatus.Unsupported;
return WebAuthnPrfStatus.Supported;
}
}

0 comments on commit ee3fad2

Please sign in to comment.