@@ -477,7 +477,7 @@ public async Task<IActionResult> IsEmailAddressAvailableAsync(string email)
477
477
return StatusCode ( StatusCodes . Status204NoContent ) ;
478
478
479
479
email = email . Trim ( ) . ToLowerInvariant ( ) ;
480
- if ( String . Equals ( CurrentUser . EmailAddress , email , StringComparison . InvariantCultureIgnoreCase ) )
480
+ if ( User . IsUserAuthType ( ) && String . Equals ( CurrentUser . EmailAddress , email , StringComparison . InvariantCultureIgnoreCase ) )
481
481
return StatusCode ( StatusCodes . Status201Created ) ;
482
482
483
483
// Only allow 3 checks attempts per hour period by a single ip.
@@ -631,7 +631,7 @@ private async Task AddGlobalAdminRoleIfFirstUserAsync(User user)
631
631
632
632
private async Task < ActionResult < TokenResult > > ExternalLoginAsync < TClient > ( ExternalAuthInfo authInfo , string ? appId , string ? appSecret , Func < IRequestFactory , IClientConfiguration , TClient > createClient ) where TClient : OAuth2Client
633
633
{
634
- using var _ = _logger . BeginScope ( new ExceptionlessState ( ) . Tag ( "External Login" ) . Identity ( CurrentUser . EmailAddress ) . Property ( "User" , CurrentUser ) . SetHttpContext ( HttpContext ) ) ;
634
+ using var _ = _logger . BeginScope ( new ExceptionlessState ( ) . Tag ( "External Login" ) . SetHttpContext ( HttpContext ) ) ;
635
635
if ( String . IsNullOrEmpty ( appId ) || String . IsNullOrEmpty ( appSecret ) )
636
636
throw new ConfigurationErrorsException ( "Missing Configuration for OAuth provider" ) ;
637
637
@@ -679,7 +679,7 @@ private async Task<ActionResult<TokenResult>> ExternalLoginAsync<TClient>(Extern
679
679
private async Task < User > FromExternalLoginAsync ( UserInfo userInfo )
680
680
{
681
681
var existingUser = await _userRepository . GetUserByOAuthProviderAsync ( userInfo . ProviderName , userInfo . Id ) ;
682
- using var _ = _logger . BeginScope ( new ExceptionlessState ( ) . Tag ( "External Login" ) . Identity ( CurrentUser . EmailAddress ) . Property ( "User Info" , userInfo ) . Property ( "User" , CurrentUser ) . Property ( "ExistingUser" , existingUser ) . SetHttpContext ( HttpContext ) ) ;
682
+ using var _ = _logger . BeginScope ( new ExceptionlessState ( ) . Tag ( "External Login" ) . Property ( "User Info" , userInfo ) . Property ( "ExistingUser" , existingUser ) . SetHttpContext ( HttpContext ) ) ;
683
683
684
684
// Link user accounts.
685
685
if ( User . IsUserAuthType ( ) )
0 commit comments