Merge branch 'release/BasePathIdentityFix02'
This commit is contained in:
@@ -12,6 +12,5 @@
|
||||
}
|
||||
|
||||
return Redirect(returnUrl);
|
||||
// return Redirect("~/");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,24 +4,26 @@
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
|
||||
<ul class="navbar-nav">
|
||||
@if (SignInManager.IsSignedIn(User))
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity?.Name!</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="/" method="post">
|
||||
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
|
||||
</form>
|
||||
</li>
|
||||
}
|
||||
else
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">Register</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">Login</a>
|
||||
</li>
|
||||
}
|
||||
@if (SignInManager.IsSignedIn(User))
|
||||
{
|
||||
string baseUrl = Url.Content("~/");
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="@($"{baseUrl}/Account/Manage/Index")" title="Manage">Hello @User.Identity?.Name!</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<form class="form-inline" asp-area="Identity" asp-page="@($"{baseUrl}/Account/Logout")" asp-route-returnUrl="/" method="post">
|
||||
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
|
||||
</form>
|
||||
</li>
|
||||
}
|
||||
else
|
||||
{
|
||||
string baseUrl = Url.Content("~/");
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="@($"{baseUrl}/Account/Register")">Register</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="Identity" asp-page="@($"{baseUrl}/Account/Login")">Login</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.Security.Policy;
|
||||
using WebDoorCreator.Data.DbModels;
|
||||
using WebDoorCreator.Data.Services;
|
||||
using WebDoorCreator.UI.Data;
|
||||
@@ -28,6 +29,7 @@ namespace WebDoorCreator.UI.Components.Gen
|
||||
|
||||
protected string baseUrl
|
||||
{
|
||||
// string baseUrl = Url.Content("~/");
|
||||
get => configuration.GetValue<string>("RuntimeOpt:BaseUrl");
|
||||
}
|
||||
|
||||
@@ -239,6 +241,11 @@ namespace WebDoorCreator.UI.Components.Gen
|
||||
{
|
||||
get
|
||||
{
|
||||
#if false
|
||||
string baseUrl = Url.Content("~/");
|
||||
#endif
|
||||
string answ = $"{baseUrl}/Identity/Account/LogOut";
|
||||
#if false
|
||||
string answ = "";
|
||||
if (NavManager.Uri.Contains("/WDC/UI"))
|
||||
{
|
||||
@@ -247,7 +254,8 @@ namespace WebDoorCreator.UI.Components.Gen
|
||||
else
|
||||
{
|
||||
answ = "/Identity/Account/LogOut";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user