bug fixes
This commit is contained in:
parent
9aa7b3c77d
commit
852020f98f
28 changed files with 261 additions and 234 deletions
|
|
@ -235,9 +235,16 @@ namespace Yavsc.Controllers
|
|||
/// <summary>
|
||||
/// Show logout page
|
||||
/// </summary>
|
||||
[HttpGet]
|
||||
[HttpGet][Authorize]
|
||||
public async Task<IActionResult> Logout(string logoutId)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(logoutId))
|
||||
{
|
||||
if (User.Identity.IsAuthenticated)
|
||||
{
|
||||
logoutId = User.GetUserId();
|
||||
}
|
||||
}
|
||||
// build a model so the logout page knows what to display
|
||||
var vm = await BuildLogoutViewModelAsync(logoutId);
|
||||
|
||||
|
|
@ -265,9 +272,11 @@ namespace Yavsc.Controllers
|
|||
{
|
||||
// delete local authentication cookie
|
||||
await HttpContext.SignOutAsync();
|
||||
await _signInManager.SignOutAsync();
|
||||
|
||||
// raise the logout event
|
||||
await _events.RaiseAsync(new UserLogoutSuccessEvent(User.GetSubjectId(), User.GetDisplayName()));
|
||||
|
||||
}
|
||||
|
||||
// check if we need to trigger sign-out at an upstream identity provider
|
||||
|
|
@ -282,6 +291,9 @@ namespace Yavsc.Controllers
|
|||
return SignOut(new AuthenticationProperties { RedirectUri = url }, vm.ExternalAuthenticationScheme);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return View("LoggedOut", vm);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue