Simplify blazorserver template for individual local auth support (#25523)
This commit is contained in:
parent
9cbf55b094
commit
0a33267c1c
|
|
@ -26,31 +26,6 @@
|
|||
"sources": [
|
||||
{
|
||||
"modifiers": [
|
||||
{
|
||||
"condition": "(!OrganizationalAuth && !IndividualAuth)",
|
||||
"exclude": [
|
||||
"Areas/Identity/Pages/Shared/_LoginPartial.Identity.cshtml",
|
||||
"Areas/Identity/Pages/Shared/_LoginPartial.OrgAuth.cshtml"
|
||||
]
|
||||
},
|
||||
{
|
||||
"condition": "(OrganizationalAuth || IndividualB2CAuth)",
|
||||
"rename": {
|
||||
"Areas/Identity/Pages/Shared/_LoginPartial.OrgAuth.cshtml": "Areas/Identity/Pages/Shared/_LoginPartial.cshtml"
|
||||
},
|
||||
"exclude": [
|
||||
"Areas/Identity/Pages/Shared/_LoginPartial.Identity.cshtml"
|
||||
]
|
||||
},
|
||||
{
|
||||
"condition": "(IndividualLocalAuth)",
|
||||
"rename": {
|
||||
"Areas/Identity/Pages/Shared/_LoginPartial.Identity.cshtml": "Areas/Identity/Pages/Shared/_LoginPartial.cshtml"
|
||||
},
|
||||
"exclude": [
|
||||
"Areas/Identity/Pages/Shared/_LoginPartial.OrgAuth.cshtml"
|
||||
]
|
||||
},
|
||||
{
|
||||
"condition": "(!IndividualLocalAuth || UseLocalDB)",
|
||||
"exclude": [
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
@using Microsoft.AspNetCore.Identity
|
||||
@inject SignInManager<IdentityUser> SignInManager
|
||||
@inject UserManager<IdentityUser> UserManager
|
||||
@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="MicrosoftIdentity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<form class="form-inline" asp-area="MicrosoftIdentity" 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="MicrosoftIdentity" asp-page="/Account/Register">Register</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="MicrosoftIdentity" asp-page="/Account/Login">Login</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
@using Microsoft.AspNetCore.Components.Forms
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||
@using Microsoft.JSInterop
|
||||
@using BlazorServerWeb_CSharp
|
||||
@using BlazorServerWeb_CSharp.Shared
|
||||
|
|
|
|||
Loading…
Reference in New Issue