Browse Source

Merge branch 'feature/pager-in-localstore'

pull/453/head
Sebastian 6 years ago
parent
commit
74eafbeea7
  1. 22
      backend/src/Squidex/Areas/IdentityServer/Controllers/Account/AccountController.cs

22
backend/src/Squidex/Areas/IdentityServer/Controllers/Account/AccountController.cs

@ -13,6 +13,9 @@ using System.Security;
using System.Security.Claims; using System.Security.Claims;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using IdentityModel;
using IdentityServer4;
using IdentityServer4.Extensions;
using IdentityServer4.Models; using IdentityServer4.Models;
using IdentityServer4.Services; using IdentityServer4.Services;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
@ -145,10 +148,25 @@ namespace Squidex.Areas.IdentityServer.Controllers.Account
[Route("account/logout/")] [Route("account/logout/")]
public async Task<IActionResult> Logout(string logoutId) public async Task<IActionResult> Logout(string logoutId)
{ {
var context = await interactions.GetLogoutContextAsync(logoutId);
await signInManager.SignOutAsync(); await signInManager.SignOutAsync();
if (User?.Identity.IsAuthenticated == true)
{
var provider = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value;
if (provider != null && provider != IdentityServerConstants.LocalIdentityProvider)
{
var providerSupportsSignout = await HttpContext.GetSchemeSupportsSignOutAsync(provider);
if (providerSupportsSignout)
{
return SignOut(provider);
}
}
}
var context = await interactions.GetLogoutContextAsync(logoutId);
return RedirectToLogoutUrl(context); return RedirectToLogoutUrl(context);
} }

Loading…
Cancel
Save