22using Coalesce . Starter . Vue . Data . Models ;
33using IntelliTect . Coalesce . Models ;
44using Microsoft . AspNetCore . Authentication ;
5+ #if GoogleAuth
56using Microsoft . AspNetCore . Authentication . Google ;
7+ #endif
8+ #if MicrosoftAuth
69using Microsoft . AspNetCore . Authentication . MicrosoftAccount ;
10+ #endif
711using Microsoft . AspNetCore . Authorization ;
812using Microsoft . AspNetCore . Identity ;
913using Microsoft . AspNetCore . Mvc ;
@@ -29,7 +33,7 @@ ILogger<ExternalLoginModel> logger
2933 public string ? ReturnUrl { get ; set ; }
3034
3135 public string ? ErrorMessage { get ; set ; }
32-
36+
3337 public IActionResult OnGet ( ) => RedirectToPage ( "Login" ) ;
3438
3539 public IActionResult OnPost ( string provider )
@@ -131,7 +135,7 @@ private async Task<IActionResult> OnMicrosoftTicketReceived(ExternalLoginInfo in
131135#if UserPictures
132136 // Populate or update user photo from Microsoft Graph
133137 await UpdateUserPhoto ( user ,
134- HttpContext . RequestServices . GetRequiredService < IOptions < MicrosoftAccountOptions > > ( ) . Value . Backchannel ,
138+ HttpContext . RequestServices . GetRequiredService < IOptions < MicrosoftAccountOptions > > ( ) . Value . Backchannel ,
135139 ( ) =>
136140 {
137141 var request = new HttpRequestMessage ( HttpMethod . Get , "https://graph.microsoft.com/v1.0/me/photos/96x96/$value" ) ;
@@ -229,10 +233,10 @@ string externalTenantId
229233 if ( tenant is null )
230234 {
231235 // Automatically create a tenant in our application based on the external tenant.
232- db . Tenants . Add ( tenant = new ( )
236+ db . Tenants . Add ( tenant = new ( )
233237 {
234- ExternalId = externalId ,
235- Name = user . Email ? . Split ( '@' ) . Last ( ) ?? externalId
238+ ExternalId = externalId ,
239+ Name = user . Email ? . Split ( '@' ) . Last ( ) ?? externalId
236240 } ) ;
237241 await db . SaveChangesAsync ( ) ;
238242
0 commit comments