Clean up SignIn action
This commit is contained in:
		
							parent
							
								
									184ed15ef6
								
							
						
					
					
						commit
						bdebee70dc
					
				@ -11,17 +11,9 @@ public class AccountController : Controller
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    [Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)]
 | 
					    [Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)]
 | 
				
			||||||
    public async Task<IActionResult> SignIn(string returnUrl)
 | 
					    public IActionResult SignIn(string returnUrl)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        var user = User as ClaimsPrincipal;
 | 
					        _logger.LogInformation("User {@User} authenticated", User.Identity.Name);
 | 
				
			||||||
        var token = await HttpContext.GetTokenAsync("access_token");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        _logger.LogInformation("User {@User} authenticated", user);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (token != null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            ViewData["access_token"] = token;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // "Catalog" because UrlHelper doesn't support nameof() for controllers
 | 
					        // "Catalog" because UrlHelper doesn't support nameof() for controllers
 | 
				
			||||||
        // https://github.com/aspnet/Mvc/issues/5853
 | 
					        // https://github.com/aspnet/Mvc/issues/5853
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user