Skip to content

Commit fe62ce7

Browse files
authored
Fail fast if authenticator key is null (#14037)
1 parent 4fd9d38 commit fe62ce7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Identity/Extensions.Core/src/AuthenticatorTokenProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public virtual async Task<bool> ValidateAsync(string purpose, string token, User
4848
{
4949
var key = await manager.GetAuthenticatorKeyAsync(user);
5050
int code;
51-
if (!int.TryParse(token, out code))
51+
if (key == null || !int.TryParse(token, out code))
5252
{
5353
return false;
5454
}

0 commit comments

Comments
 (0)