File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -759,13 +759,12 @@ async Task<PublicKeyCredentialDescriptor[]> GetAllowCredentialsAsync()
759759 var result = await Context . AuthenticateAsync ( IdentityConstants . TwoFactorUserIdScheme ) ;
760760 await Context . SignOutAsync ( IdentityConstants . TwoFactorUserIdScheme ) ;
761761
762- if ( result ? . Principal == null )
762+ if ( result ? . Principal == null || result . Properties is not { } properties )
763763 {
764764 return null ;
765765 }
766766
767- var optionsJson = result . Properties ? . Items [ PasskeyCreationOptionsKey ] ;
768- if ( optionsJson == null )
767+ if ( ! properties . Items . TryGetValue ( PasskeyCreationOptionsKey , out var optionsJson ) || optionsJson is null )
769768 {
770769 return null ;
771770 }
@@ -798,13 +797,12 @@ async Task<PublicKeyCredentialDescriptor[]> GetAllowCredentialsAsync()
798797 var result = await Context . AuthenticateAsync ( IdentityConstants . TwoFactorUserIdScheme ) ;
799798 await Context . SignOutAsync ( IdentityConstants . TwoFactorUserIdScheme ) ;
800799
801- if ( result ? . Principal == null )
800+ if ( result ? . Principal == null || result . Properties is not { } properties )
802801 {
803802 return null ;
804803 }
805804
806- var optionsJson = result . Properties ? . Items [ PasskeyRequestOptionsKey ] ;
807- if ( optionsJson == null )
805+ if ( ! properties . Items . TryGetValue ( PasskeyRequestOptionsKey , out var optionsJson ) || optionsJson is null )
808806 {
809807 return null ;
810808 }
You can’t perform that action at this time.
0 commit comments