auth improvements related to multi-tenancy

This commit is contained in:
Shaun Walker
2021-05-19 08:46:02 -04:00
parent 943adec3a0
commit 09537ab0e4
23 changed files with 235 additions and 134 deletions

View File

@ -1,9 +1,9 @@
using System.Threading.Tasks;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Oqtane.Shared;
namespace Oqtane.Pages
{
@ -12,7 +12,10 @@ namespace Oqtane.Pages
{
public async Task<IActionResult> OnPostAsync(string returnurl)
{
await HttpContext.SignOutAsync(IdentityConstants.ApplicationScheme);
if (HttpContext.User.Identity.IsAuthenticated)
{
await HttpContext.SignOutAsync(Constants.AuthenticationScheme);
}
if (returnurl == null)
{
@ -26,4 +29,4 @@ namespace Oqtane.Pages
return LocalRedirect(Url.Content("~" + returnurl));
}
}
}
}