Merge branch 'merge/release/2.2-to-master'
This commit is contained in:
commit
3570f1a2b1
|
|
@ -2,7 +2,6 @@ trigger:
|
||||||
- master
|
- master
|
||||||
- release/*
|
- release/*
|
||||||
|
|
||||||
# See https://github.com/aspnet/BuildTools
|
|
||||||
resources:
|
resources:
|
||||||
repositories:
|
repositories:
|
||||||
- repository: buildtools
|
- repository: buildtools
|
||||||
|
|
@ -11,36 +10,4 @@ resources:
|
||||||
ref: refs/heads/master
|
ref: refs/heads/master
|
||||||
|
|
||||||
phases:
|
phases:
|
||||||
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
|
- template: ../templates/project-ci.yml
|
||||||
parameters:
|
|
||||||
agentOs: Windows
|
|
||||||
beforeBuild:
|
|
||||||
- task: NodeTool@0
|
|
||||||
displayName: Use Node 8.x
|
|
||||||
inputs:
|
|
||||||
versionSpec: 8.x
|
|
||||||
|
|
||||||
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
|
|
||||||
parameters:
|
|
||||||
agentOs: macOS
|
|
||||||
beforeBuild:
|
|
||||||
- task: NodeTool@0
|
|
||||||
displayName: Use Node 8.x
|
|
||||||
inputs:
|
|
||||||
versionSpec: 8.x
|
|
||||||
- script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
|
|
||||||
displayName: install certs
|
|
||||||
env:
|
|
||||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
|
||||||
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
|
||||||
|
|
||||||
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
|
|
||||||
parameters:
|
|
||||||
agentOs: Linux
|
|
||||||
beforeBuild:
|
|
||||||
- task: NodeTool@0
|
|
||||||
displayName: Use Node 8.x
|
|
||||||
inputs:
|
|
||||||
versionSpec: 8.x
|
|
||||||
- script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
|
|
||||||
displayName: install certs
|
|
||||||
|
|
|
||||||
|
|
@ -12,36 +12,4 @@ resources:
|
||||||
ref: refs/heads/master
|
ref: refs/heads/master
|
||||||
|
|
||||||
phases:
|
phases:
|
||||||
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
|
- template: ../templates/project-ci.yml
|
||||||
parameters:
|
|
||||||
agentOs: Windows
|
|
||||||
beforeBuild:
|
|
||||||
- task: NodeTool@0
|
|
||||||
displayName: Use Node 8.x
|
|
||||||
inputs:
|
|
||||||
versionSpec: 8.x
|
|
||||||
|
|
||||||
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
|
|
||||||
parameters:
|
|
||||||
agentOs: macOS
|
|
||||||
beforeBuild:
|
|
||||||
- task: NodeTool@0
|
|
||||||
displayName: Use Node 8.x
|
|
||||||
inputs:
|
|
||||||
versionSpec: 8.x
|
|
||||||
- script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
|
|
||||||
displayName: install certs
|
|
||||||
env:
|
|
||||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
|
||||||
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
|
||||||
|
|
||||||
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
|
|
||||||
parameters:
|
|
||||||
agentOs: Linux
|
|
||||||
beforeBuild:
|
|
||||||
- task: NodeTool@0
|
|
||||||
displayName: Use Node 8.x
|
|
||||||
inputs:
|
|
||||||
versionSpec: 8.x
|
|
||||||
- script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
|
|
||||||
displayName: install certs
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
# See https://github.com/aspnet/BuildTools
|
||||||
|
|
||||||
|
phases:
|
||||||
|
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
|
||||||
|
parameters:
|
||||||
|
agentOs: Windows
|
||||||
|
beforeBuild:
|
||||||
|
- task: NodeTool@0
|
||||||
|
displayName: Use Node 8.x
|
||||||
|
inputs:
|
||||||
|
versionSpec: 8.x
|
||||||
|
|
||||||
|
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
|
||||||
|
parameters:
|
||||||
|
agentOs: macOS
|
||||||
|
beforeBuild:
|
||||||
|
- task: NodeTool@0
|
||||||
|
displayName: Use Node 8.x
|
||||||
|
inputs:
|
||||||
|
versionSpec: 8.x
|
||||||
|
- script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
|
||||||
|
displayName: install certs
|
||||||
|
env:
|
||||||
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
||||||
|
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||||
|
|
||||||
|
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
|
||||||
|
parameters:
|
||||||
|
agentOs: Linux
|
||||||
|
beforeBuild:
|
||||||
|
- task: NodeTool@0
|
||||||
|
displayName: Use Node 8.x
|
||||||
|
inputs:
|
||||||
|
versionSpec: 8.x
|
||||||
|
- script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
|
||||||
|
displayName: install certs
|
||||||
|
|
@ -46,6 +46,6 @@
|
||||||
<XunitPackageVersion>2.3.1</XunitPackageVersion>
|
<XunitPackageVersion>2.3.1</XunitPackageVersion>
|
||||||
<XunitRunnerVisualStudioPackageVersion>2.4.0</XunitRunnerVisualStudioPackageVersion>
|
<XunitRunnerVisualStudioPackageVersion>2.4.0</XunitRunnerVisualStudioPackageVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="Package Versions: Pinned" />
|
|
||||||
<Import Project="$(DotNetPackageVersionPropsPath)" Condition=" '$(DotNetPackageVersionPropsPath)' != '' " />
|
<Import Project="$(DotNetPackageVersionPropsPath)" Condition=" '$(DotNetPackageVersionPropsPath)' != '' " />
|
||||||
|
<PropertyGroup Label="Package Versions: Pinned" />
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
"generatorVersions": "[1.0.0.0-*)",
|
"generatorVersions": "[1.0.0.0-*)",
|
||||||
"description": "An empty project template for creating an ASP.NET Core application. This template does not have any content in it.",
|
"description": "An empty project template for creating an ASP.NET Core application. This template does not have any content in it.",
|
||||||
"groupIdentity": "Microsoft.Web.Empty",
|
"groupIdentity": "Microsoft.Web.Empty",
|
||||||
"precedence": "3000",
|
"precedence": "5000",
|
||||||
"identity": "Microsoft.Web.Empty.CSharp.3.0",
|
"identity": "Microsoft.Web.Empty.CSharp.3.0",
|
||||||
"shortName": "web",
|
"shortName": "web",
|
||||||
"tags": {
|
"tags": {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
"generatorVersions": "[1.0.0.0-*)",
|
"generatorVersions": "[1.0.0.0-*)",
|
||||||
"description": "An empty project template for creating an ASP.NET Core application. This template does not have any content in it.",
|
"description": "An empty project template for creating an ASP.NET Core application. This template does not have any content in it.",
|
||||||
"groupIdentity": "Microsoft.Web.Empty",
|
"groupIdentity": "Microsoft.Web.Empty",
|
||||||
"precedence": "3000",
|
"precedence": "5000",
|
||||||
"identity": "Microsoft.Web.Empty.FSharp.3.0",
|
"identity": "Microsoft.Web.Empty.FSharp.3.0",
|
||||||
"shortName": "web",
|
"shortName": "web",
|
||||||
"tags": {
|
"tags": {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
"generatorVersions": "[1.0.0.0-*)",
|
"generatorVersions": "[1.0.0.0-*)",
|
||||||
"description": "A project for creating a Razor class library that targets .NET Standard",
|
"description": "A project for creating a Razor class library that targets .NET Standard",
|
||||||
"groupIdentity": "Microsoft.Web.Razor",
|
"groupIdentity": "Microsoft.Web.Razor",
|
||||||
"precedence": "3000",
|
"precedence": "5000",
|
||||||
"identity": "Microsoft.Web.Razor.Library.CSharp.3.0",
|
"identity": "Microsoft.Web.Razor.Library.CSharp.3.0",
|
||||||
"shortName": "razorclasslib",
|
"shortName": "razorclasslib",
|
||||||
"tags": {
|
"tags": {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
"generatorVersions": "[1.0.0.0-*)",
|
"generatorVersions": "[1.0.0.0-*)",
|
||||||
"description": "A project template for creating an ASP.NET Core application with example ASP.NET Razor Pages content",
|
"description": "A project template for creating an ASP.NET Core application with example ASP.NET Razor Pages content",
|
||||||
"groupIdentity": "Microsoft.Web.RazorPages",
|
"groupIdentity": "Microsoft.Web.RazorPages",
|
||||||
"precedence": "3000",
|
"precedence": "5000",
|
||||||
"identity": "Microsoft.Web.RazorPages.CSharp.3.0",
|
"identity": "Microsoft.Web.RazorPages.CSharp.3.0",
|
||||||
"shortName": [
|
"shortName": [
|
||||||
"razor",
|
"razor",
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<nav class="mb-3 navbar navbar-expand navbar-light flex-column flex-md-row bg-white border-bottom box-shadow">
|
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" asp-area="" asp-page="/">Company.WebApplication1</a>
|
<a class="navbar-brand" asp-area="" asp-page="/">Company.WebApplication1</a>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
#elseif (WindowsAuth)
|
#elseif (WindowsAuth)
|
||||||
<p class="nav navbar-text navbar-right">Hello, @User.Identity.Name!</p>
|
<p class="nav navbar-text navbar-right">Hello, @User.Identity.Name!</p>
|
||||||
#endif*@
|
#endif*@
|
||||||
<ul class="navbar-nav ml-md-auto">
|
<ul class="navbar-nav flex-grow-1">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Page1</a>
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Page1</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -51,7 +51,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="border-top footer pl-3 text-muted">
|
<footer class="border-top footer pl-3 text-muted">
|
||||||
© Year - Company.WebApplication1 - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
<div class="container">
|
||||||
|
© copyrightYear - Company.WebApplication1 - <a asp-area="" asp-page="/Privacy">Privacy</a>
|
||||||
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<environment include="Development">
|
<environment include="Development">
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,26 @@
|
||||||
@using Microsoft.AspNetCore.Identity
|
@using Microsoft.AspNetCore.Identity
|
||||||
|
|
||||||
@inject SignInManager<IdentityUser> SignInManager
|
@inject SignInManager<IdentityUser> SignInManager
|
||||||
@inject UserManager<IdentityUser> UserManager
|
@inject UserManager<IdentityUser> UserManager
|
||||||
|
|
||||||
|
<ul class="navbar-nav">
|
||||||
@if (SignInManager.IsSignedIn(User))
|
@if (SignInManager.IsSignedIn(User))
|
||||||
{
|
{
|
||||||
<form asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/Index", new { area = "" })" method="post" id="logoutForm" class="navbar-right">
|
<li class="nav-item">
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
|
||||||
<li>
|
</li>
|
||||||
<a asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @UserManager.GetUserName(User)!</a>
|
<li class="nav-item">
|
||||||
</li>
|
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/", new { area = "" })">
|
||||||
<li>
|
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
|
||||||
<button type="submit" class="btn btn-link navbar-btn navbar-link">Logout</button>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
|
||||||
</form>
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<li class="nav-item">
|
||||||
<li><a asp-area="Identity" asp-page="/Account/Register">Register</a></li>
|
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">Register</a>
|
||||||
<li><a asp-area="Identity" asp-page="/Account/Login">Login</a></li>
|
</li>
|
||||||
</ul>
|
<li class="nav-item">
|
||||||
}
|
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">Login</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
|
@ -9,39 +9,49 @@
|
||||||
|
|
||||||
#endif *@
|
#endif *@
|
||||||
|
|
||||||
|
<ul class="navbar-nav">
|
||||||
@*#if (IndividualB2CAuth)
|
@*#if (IndividualB2CAuth)
|
||||||
@if (User.Identity.IsAuthenticated)
|
@if (User.Identity.IsAuthenticated)
|
||||||
{
|
{
|
||||||
<ul class="nav navbar-nav navbar-right">
|
|
||||||
@if (!string.IsNullOrEmpty(options.EditProfilePolicyId))
|
@if (!string.IsNullOrEmpty(options.EditProfilePolicyId))
|
||||||
{
|
{
|
||||||
<li><a asp-area="AzureADB2C" asp-controller="Account" asp-action="EditProfile">Hello @User.Identity.Name!</a></li>
|
<li class="nav-item">
|
||||||
|
<a class="nav-link text-dark" asp-area="AzureADB2C" asp-controller="Account" asp-action="EditProfile">
|
||||||
|
<span class="nav-text text-dark">Hello @User.Identity.Name!</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<li class="navbar-text">Hello @User.Identity.Name!</li>
|
<li class="nav-item">
|
||||||
|
<span class="nav-text text-dark">Hello @User.Identity.Name!</span>
|
||||||
|
</li>
|
||||||
}
|
}
|
||||||
<li><a asp-area="AzureADB2C" asp-controller="Account" asp-action="SignOut">Sign out</a></li>
|
<li class="nav-item">
|
||||||
</ul>
|
<a class="nav-link text-dark" asp-area="AzureADB2C" asp-controller="Account" asp-action="SignOut">Sign out</a>
|
||||||
|
</li>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<li class="nav-item">
|
||||||
<li><a asp-area="AzureADB2C" asp-controller="Account" asp-action="SignIn">Sign in</a></li>
|
<a class="nav-link text-dark" asp-area="AzureADB2C" asp-controller="Account" asp-action="SignIn">Sign in</a>
|
||||||
</ul>
|
</li>
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@if (User.Identity.IsAuthenticated)
|
@if (User.Identity.IsAuthenticated)
|
||||||
{
|
{
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<li class="nav-item">
|
||||||
<li class="navbar-text">Hello @User.Identity.Name!</li>
|
<span class="nav-text text-dark">Hello @User.Identity.Name!</span>
|
||||||
<li><a asp-area="AzureAD" asp-controller="Account" asp-action="SignOut">Sign out</a></li>
|
</li>
|
||||||
</ul>
|
<li class="nav-item">
|
||||||
|
<a class="nav-link text-dark" asp-area="AzureAD" asp-controller="Account" asp-action="SignOut">Sign out</a>
|
||||||
|
</li>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<li class="nav-item">
|
||||||
<li><a asp-area="AzureAD" asp-controller="Account" asp-action="SignIn">Sign in</a></li>
|
<a class="nav-link text-dark" asp-area="AzureAD" asp-controller="Account" asp-action="SignIn">Sign in</a>
|
||||||
</ul>
|
</li>
|
||||||
}
|
}
|
||||||
#endif *@
|
#endif *@
|
||||||
|
</ul>
|
||||||
|
|
@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Authentication.AzureADB2C.UI;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
#if (IndividualLocalAuth)
|
#if (IndividualLocalAuth)
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
|
using Microsoft.AspNetCore.Identity.UI;
|
||||||
#endif
|
#endif
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
@ -69,6 +70,7 @@ namespace Company.WebApplication1
|
||||||
Configuration.GetConnectionString("DefaultConnection")));
|
Configuration.GetConnectionString("DefaultConnection")));
|
||||||
#endif
|
#endif
|
||||||
services.AddDefaultIdentity<IdentityUser>()
|
services.AddDefaultIdentity<IdentityUser>()
|
||||||
|
.AddDefaultUI(UIFramework.Bootstrap4)
|
||||||
.AddEntityFrameworkStores<ApplicationDbContext>();
|
.AddEntityFrameworkStores<ApplicationDbContext>();
|
||||||
|
|
||||||
#elif (OrganizationalAuth)
|
#elif (OrganizationalAuth)
|
||||||
|
|
@ -147,6 +149,7 @@ namespace Company.WebApplication1
|
||||||
{
|
{
|
||||||
app.UseExceptionHandler("/Error");
|
app.UseExceptionHandler("/Error");
|
||||||
#if (RequiresHttps)
|
#if (RequiresHttps)
|
||||||
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
app.UseHsts();
|
app.UseHsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
"generatorVersions": "[1.0.0.0-*)",
|
"generatorVersions": "[1.0.0.0-*)",
|
||||||
"description": "A project template for creating an ASP.NET Core application with example ASP.NET Core MVC Views and Controllers. This template can also be used for RESTful HTTP services.",
|
"description": "A project template for creating an ASP.NET Core application with example ASP.NET Core MVC Views and Controllers. This template can also be used for RESTful HTTP services.",
|
||||||
"groupIdentity": "Microsoft.Web.Mvc",
|
"groupIdentity": "Microsoft.Web.Mvc",
|
||||||
"precedence": "3000",
|
"precedence": "5000",
|
||||||
"identity": "Microsoft.Web.Mvc.CSharp.3.0",
|
"identity": "Microsoft.Web.Mvc.CSharp.3.0",
|
||||||
"shortName": "mvc",
|
"shortName": "mvc",
|
||||||
"thirdPartyNotices": "https://aka.ms/aspnetcore-template-3pn-210",
|
"thirdPartyNotices": "https://aka.ms/aspnetcore-template-3pn-210",
|
||||||
|
|
@ -360,4 +360,4 @@
|
||||||
"continueOnError": true
|
"continueOnError": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Authentication.AzureADB2C.UI;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
#if (IndividualLocalAuth)
|
#if (IndividualLocalAuth)
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
|
using Microsoft.AspNetCore.Identity.UI;
|
||||||
#endif
|
#endif
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
@ -69,6 +70,7 @@ namespace Company.WebApplication1
|
||||||
Configuration.GetConnectionString("DefaultConnection")));
|
Configuration.GetConnectionString("DefaultConnection")));
|
||||||
#endif
|
#endif
|
||||||
services.AddDefaultIdentity<IdentityUser>()
|
services.AddDefaultIdentity<IdentityUser>()
|
||||||
|
.AddDefaultUI(UIFramework.Bootstrap4)
|
||||||
.AddEntityFrameworkStores<ApplicationDbContext>();
|
.AddEntityFrameworkStores<ApplicationDbContext>();
|
||||||
#elif (OrganizationalAuth)
|
#elif (OrganizationalAuth)
|
||||||
services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
|
services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
|
||||||
|
|
@ -146,6 +148,7 @@ namespace Company.WebApplication1
|
||||||
{
|
{
|
||||||
app.UseExceptionHandler("/Home/Error");
|
app.UseExceptionHandler("/Home/Error");
|
||||||
#if (RequiresHttps)
|
#if (RequiresHttps)
|
||||||
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
app.UseHsts();
|
app.UseHsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
<header>
|
<header>
|
||||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="~/">Company.WebApplication1</a>
|
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Company.WebApplication1</a>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||||
aria-expanded="false" aria-label="Toggle navigation">
|
aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,26 @@
|
||||||
|
@using Microsoft.AspNetCore.Identity
|
||||||
|
@inject SignInManager<IdentityUser> SignInManager
|
||||||
|
@inject UserManager<IdentityUser> UserManager
|
||||||
|
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
@if (User.Identity.IsAuthenticated)
|
@if (SignInManager.IsSignedIn(User))
|
||||||
{
|
{
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a id="manage" class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
|
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<form id="logoutForm" class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/Index", new { area = "" })">
|
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Action("Index", "Home", new { area = "" })">
|
||||||
<button id="logout" type="submit" class="nav-link btn btn-link text-dark">Logout</button>
|
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" id="register" asp-area="Identity" asp-page="/Account/Register">Register</a>
|
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">Register</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" id="login" asp-area="Identity" asp-page="/Account/Login">Login</a>
|
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">Login</a>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -10,39 +10,49 @@
|
||||||
|
|
||||||
#endif *@
|
#endif *@
|
||||||
|
|
||||||
|
<ul class="navbar-nav">
|
||||||
@*#if (IndividualB2CAuth)
|
@*#if (IndividualB2CAuth)
|
||||||
@if (User.Identity.IsAuthenticated)
|
@if (User.Identity.IsAuthenticated)
|
||||||
{
|
{
|
||||||
<ul class="nav navbar-nav navbar-right">
|
|
||||||
@if (!string.IsNullOrEmpty(options.EditProfilePolicyId))
|
@if (!string.IsNullOrEmpty(options.EditProfilePolicyId))
|
||||||
{
|
{
|
||||||
<li><a asp-area="AzureADB2C" asp-controller="Account" asp-action="EditProfile">Hello @User.Identity.Name!</a></li>
|
<li class="nav-item">
|
||||||
|
<a class="nav-link text-dark" asp-area="AzureADB2C" asp-controller="Account" asp-action="EditProfile">
|
||||||
|
<span class="nav-text text-dark">Hello @User.Identity.Name!</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<li class="navbar-text">Hello @User.Identity.Name!</li>
|
<li class="nav-item">
|
||||||
|
<span class="nav-text text-dark">Hello @User.Identity.Name!</span>
|
||||||
|
</li>
|
||||||
}
|
}
|
||||||
<li><a asp-area="AzureADB2C" asp-controller="Account" asp-action="SignOut">Sign out</a></li>
|
<li class="nav-item">
|
||||||
</ul>
|
<a class="nav-link text-dark" asp-area="AzureADB2C" asp-controller="Account" asp-action="SignOut">Sign out</a>
|
||||||
|
</li>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<li class="nav-item">
|
||||||
<li><a asp-area="AzureADB2C" asp-controller="Account" asp-action="SignIn">Sign in</a></li>
|
<a class="nav-link text-dark" asp-area="AzureADB2C" asp-controller="Account" asp-action="SignIn">Sign in</a>
|
||||||
</ul>
|
</li>
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@if (User.Identity.IsAuthenticated)
|
@if (User.Identity.IsAuthenticated)
|
||||||
{
|
{
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<li class="nav-item">
|
||||||
<li class="navbar-text">Hello @User.Identity.Name!</li>
|
<span class="nav-text text-dark">Hello @User.Identity.Name!</span>
|
||||||
<li><a asp-area="AzureAD" asp-controller="Account" asp-action="SignOut">Sign out</a></li>
|
</li>
|
||||||
</ul>
|
<li class="nav-item">
|
||||||
|
<a class="nav-link text-dark" asp-area="AzureAD" asp-controller="Account" asp-action="SignOut">Sign out</a>
|
||||||
|
</li>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<li class="nav-item">
|
||||||
<li><a asp-area="AzureAD" asp-controller="Account" asp-action="SignIn">Sign in</a></li>
|
<a class="nav-link text-dark" asp-area="AzureAD" asp-controller="Account" asp-action="SignIn">Sign in</a>
|
||||||
</ul>
|
</li>
|
||||||
}
|
}
|
||||||
#endif *@
|
#endif *@
|
||||||
|
</ul>
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
"generatorVersions": "[1.0.0.0-*)",
|
"generatorVersions": "[1.0.0.0-*)",
|
||||||
"description": "A project template for creating an ASP.NET Core application with example ASP.NET Core MVC Views and Controllers. This template can also be used for RESTful HTTP services.",
|
"description": "A project template for creating an ASP.NET Core application with example ASP.NET Core MVC Views and Controllers. This template can also be used for RESTful HTTP services.",
|
||||||
"groupIdentity": "Microsoft.Web.Mvc",
|
"groupIdentity": "Microsoft.Web.Mvc",
|
||||||
"precedence": "3000",
|
"precedence": "5000",
|
||||||
"identity": "Microsoft.Web.Mvc.FSharp.3.0",
|
"identity": "Microsoft.Web.Mvc.FSharp.3.0",
|
||||||
"shortName": "mvc",
|
"shortName": "mvc",
|
||||||
"thirdPartyNotices": "https://aka.ms/aspnetcore-template-3pn-210",
|
"thirdPartyNotices": "https://aka.ms/aspnetcore-template-3pn-210",
|
||||||
|
|
@ -153,4 +153,4 @@
|
||||||
"continueOnError": true
|
"continueOnError": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ type Startup private () =
|
||||||
else
|
else
|
||||||
app.UseExceptionHandler("/Home/Error") |> ignore
|
app.UseExceptionHandler("/Home/Error") |> ignore
|
||||||
#if (!NoHttps)
|
#if (!NoHttps)
|
||||||
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
app.UseHsts() |> ignore
|
app.UseHsts() |> ignore
|
||||||
|
|
||||||
app.UseHttpsRedirection() |> ignore
|
app.UseHttpsRedirection() |> ignore
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
"generatorVersions": "[1.0.0.0-*)",
|
"generatorVersions": "[1.0.0.0-*)",
|
||||||
"description": "A project template for creating an ASP.NET Core application with an example Controller for a RESTful HTTP service. This template can also be used for ASP.NET Core MVC Views and Controllers.",
|
"description": "A project template for creating an ASP.NET Core application with an example Controller for a RESTful HTTP service. This template can also be used for ASP.NET Core MVC Views and Controllers.",
|
||||||
"groupIdentity": "Microsoft.Web.WebApi",
|
"groupIdentity": "Microsoft.Web.WebApi",
|
||||||
"precedence": "3000",
|
"precedence": "5000",
|
||||||
"identity": "Microsoft.Web.WebApi.CSharp.3.0",
|
"identity": "Microsoft.Web.WebApi.CSharp.3.0",
|
||||||
"shortName": "webapi",
|
"shortName": "webapi",
|
||||||
"tags": {
|
"tags": {
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ namespace Company.WebApplication1
|
||||||
#if (RequiresHttps)
|
#if (RequiresHttps)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
app.UseHsts();
|
app.UseHsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
"generatorVersions": "[1.0.0.0-*)",
|
"generatorVersions": "[1.0.0.0-*)",
|
||||||
"description": "A project template for creating an ASP.NET Core application with an example Controller for a RESTful HTTP service. This template can also be used for ASP.NET Core MVC Views and Controllers.",
|
"description": "A project template for creating an ASP.NET Core application with an example Controller for a RESTful HTTP service. This template can also be used for ASP.NET Core MVC Views and Controllers.",
|
||||||
"groupIdentity": "Microsoft.Web.WebApi",
|
"groupIdentity": "Microsoft.Web.WebApi",
|
||||||
"precedence": "3000",
|
"precedence": "5000",
|
||||||
"identity": "Microsoft.Web.WebApi.FSharp.3.0",
|
"identity": "Microsoft.Web.WebApi.FSharp.3.0",
|
||||||
"shortName": "webapi",
|
"shortName": "webapi",
|
||||||
"tags": {
|
"tags": {
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ type Startup private () =
|
||||||
app.UseDeveloperExceptionPage() |> ignore
|
app.UseDeveloperExceptionPage() |> ignore
|
||||||
#if (!NoHttps)
|
#if (!NoHttps)
|
||||||
else
|
else
|
||||||
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
app.UseHsts() |> ignore
|
app.UseHsts() |> ignore
|
||||||
|
|
||||||
app.UseHttpsRedirection() |> ignore
|
app.UseHttpsRedirection() |> ignore
|
||||||
|
|
@ -37,4 +38,4 @@ type Startup private () =
|
||||||
#endif
|
#endif
|
||||||
app.UseMvc() |> ignore
|
app.UseMvc() |> ignore
|
||||||
|
|
||||||
member val Configuration : IConfiguration = null with get, set
|
member val Configuration : IConfiguration = null with get, set
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ namespace Company.WebApplication1
|
||||||
{
|
{
|
||||||
app.UseExceptionHandler("/Error");
|
app.UseExceptionHandler("/Error");
|
||||||
#if (!NoHttps)
|
#if (!NoHttps)
|
||||||
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
app.UseHsts();
|
app.UseHsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ namespace Company.WebApplication1
|
||||||
{
|
{
|
||||||
app.UseExceptionHandler("/Error");
|
app.UseExceptionHandler("/Error");
|
||||||
#if (!NoHttps)
|
#if (!NoHttps)
|
||||||
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
app.UseHsts();
|
app.UseHsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ namespace Company.WebApplication1
|
||||||
{
|
{
|
||||||
app.UseExceptionHandler("/Error");
|
app.UseExceptionHandler("/Error");
|
||||||
#if (!NoHttps)
|
#if (!NoHttps)
|
||||||
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
app.UseHsts();
|
app.UseHsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue