-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update BlazorAuthClient to dotnet 5 (address #2)
- Loading branch information
1 parent
91abad8
commit 06e2f36
Showing
26 changed files
with
368 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30001.183 | ||
VisualStudioVersion = 16.0.30717.126 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorAuthClient.Server", "BlazorAuthClient\Server\BlazorAuthClient.Server.csproj", "{404025C9-1B25-42C5-B1F6-5D84DCE3D257}" | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorAuthClient.Server", "BlazorAuthClient\Server\BlazorAuthClient.Server.csproj", "{BBB537A6-3925-4061-BFBC-4AE9C6488236}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorAuthClient.Client", "BlazorAuthClient\Client\BlazorAuthClient.Client.csproj", "{00AC37BA-8465-4CCE-AD84-A4ACE61F32C7}" | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorAuthClient.Client", "BlazorAuthClient\Client\BlazorAuthClient.Client.csproj", "{56B4573A-BB1E-44CB-9046-09A47CBD2E7C}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorAuthClient.Shared", "BlazorAuthClient\Shared\BlazorAuthClient.Shared.csproj", "{582C263D-D9FE-487C-834E-0D9F50C9C003}" | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorAuthClient.Shared", "BlazorAuthClient\Shared\BlazorAuthClient.Shared.csproj", "{DA269CEC-CF51-4530-BBF8-C9F5018C0E8F}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{404025C9-1B25-42C5-B1F6-5D84DCE3D257}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{404025C9-1B25-42C5-B1F6-5D84DCE3D257}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{404025C9-1B25-42C5-B1F6-5D84DCE3D257}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{404025C9-1B25-42C5-B1F6-5D84DCE3D257}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{00AC37BA-8465-4CCE-AD84-A4ACE61F32C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{00AC37BA-8465-4CCE-AD84-A4ACE61F32C7}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{00AC37BA-8465-4CCE-AD84-A4ACE61F32C7}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{00AC37BA-8465-4CCE-AD84-A4ACE61F32C7}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{582C263D-D9FE-487C-834E-0D9F50C9C003}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{582C263D-D9FE-487C-834E-0D9F50C9C003}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{582C263D-D9FE-487C-834E-0D9F50C9C003}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{582C263D-D9FE-487C-834E-0D9F50C9C003}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{BBB537A6-3925-4061-BFBC-4AE9C6488236}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{BBB537A6-3925-4061-BFBC-4AE9C6488236}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{BBB537A6-3925-4061-BFBC-4AE9C6488236}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{BBB537A6-3925-4061-BFBC-4AE9C6488236}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{56B4573A-BB1E-44CB-9046-09A47CBD2E7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{56B4573A-BB1E-44CB-9046-09A47CBD2E7C}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{56B4573A-BB1E-44CB-9046-09A47CBD2E7C}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{56B4573A-BB1E-44CB-9046-09A47CBD2E7C}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{DA269CEC-CF51-4530-BBF8-C9F5018C0E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{DA269CEC-CF51-4530-BBF8-C9F5018C0E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{DA269CEC-CF51-4530-BBF8-C9F5018C0E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{DA269CEC-CF51-4530-BBF8-C9F5018C0E8F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {013603B4-8527-4DC3-B130-94057747C3EA} | ||
SolutionGuid = {93E4131A-53FA-4C11-8922-6E45CAD5A8D4} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ | |
</LayoutView> | ||
</NotFound> | ||
</Router> | ||
</CascadingAuthenticationState> | ||
</CascadingAuthenticationState> |
15 changes: 7 additions & 8 deletions
15
BlazorAuthClient/BlazorAuthClient/Client/BlazorAuthClient.Client.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
BlazorAuthClient/BlazorAuthClient/Client/CustomAuthenticationStateProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 23 additions & 22 deletions
45
BlazorAuthClient/BlazorAuthClient/Client/Shared/MainLayout.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
@inherits LayoutComponentBase | ||
@inject CurrentUserService CurrentUserService | ||
|
||
<div class="sidebar"> | ||
<NavMenu /> | ||
</div> | ||
|
||
<div class="main"> | ||
<div class="top-row px-4"> | ||
<AuthorizeView> | ||
<Authorized> | ||
Hello, @context.User.Identity.Name | ||
<a href="Logout">Log out</a> | ||
</Authorized> | ||
<NotAuthorized> | ||
<a href="Login">Log in</a> | ||
</NotAuthorized> | ||
<Authorizing> | ||
Authorizing... | ||
</Authorizing> | ||
</AuthorizeView> | ||
<a href="http://blazor.net" target="_blank" class="ml-md-auto">About</a> | ||
<div class="page"> | ||
<div class="sidebar"> | ||
<NavMenu /> | ||
</div> | ||
|
||
<div class="content px-4"> | ||
@Body | ||
<div class="main"> | ||
<div class="top-row px-4 auth"> | ||
<AuthorizeView> | ||
<Authorized> | ||
Hello, @context.User.Identity.Name | ||
<a href="Logout">Log out</a> | ||
</Authorized> | ||
<NotAuthorized> | ||
<a href="Login">Log in</a> | ||
</NotAuthorized> | ||
<Authorizing> | ||
Authorizing... | ||
</Authorizing> | ||
</AuthorizeView> | ||
<a href="http://blazor.net" target="_blank" class="ml-md-auto">About</a> | ||
</div> | ||
|
||
<div class="content px-4"> | ||
@Body | ||
</div> | ||
</div> | ||
</div> |
70 changes: 70 additions & 0 deletions
70
BlazorAuthClient/BlazorAuthClient/Client/Shared/MainLayout.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
.page { | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.main { | ||
flex: 1; | ||
} | ||
|
||
.sidebar { | ||
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); | ||
} | ||
|
||
.top-row { | ||
background-color: #f7f7f7; | ||
border-bottom: 1px solid #d6d5d5; | ||
justify-content: flex-end; | ||
height: 3.5rem; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.top-row ::deep a, .top-row .btn-link { | ||
white-space: nowrap; | ||
margin-left: 1.5rem; | ||
} | ||
|
||
.top-row a:first-child { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
@media (max-width: 640.98px) { | ||
.top-row:not(.auth) { | ||
display: none; | ||
} | ||
|
||
.top-row.auth { | ||
justify-content: space-between; | ||
} | ||
|
||
.top-row a, .top-row .btn-link { | ||
margin-left: 0; | ||
} | ||
} | ||
|
||
@media (min-width: 641px) { | ||
.page { | ||
flex-direction: row; | ||
} | ||
|
||
.sidebar { | ||
width: 250px; | ||
height: 100vh; | ||
position: sticky; | ||
top: 0; | ||
} | ||
|
||
.top-row { | ||
position: sticky; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
|
||
.main > div { | ||
padding-left: 2rem !important; | ||
padding-right: 1.5rem !important; | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
BlazorAuthClient/BlazorAuthClient/Client/Shared/NavMenu.razor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.navbar-toggler { | ||
background-color: rgba(255, 255, 255, 0.1); | ||
} | ||
|
||
.top-row { | ||
height: 3.5rem; | ||
background-color: rgba(0,0,0,0.4); | ||
} | ||
|
||
.navbar-brand { | ||
font-size: 1.1rem; | ||
} | ||
|
||
.oi { | ||
width: 2rem; | ||
font-size: 1.1rem; | ||
vertical-align: text-top; | ||
top: -2px; | ||
} | ||
|
||
.nav-item { | ||
font-size: 0.9rem; | ||
padding-bottom: 0.5rem; | ||
} | ||
|
||
.nav-item:first-of-type { | ||
padding-top: 1rem; | ||
} | ||
|
||
.nav-item:last-of-type { | ||
padding-bottom: 1rem; | ||
} | ||
|
||
.nav-item ::deep a { | ||
color: #d7d7d7; | ||
border-radius: 4px; | ||
height: 3rem; | ||
display: flex; | ||
align-items: center; | ||
line-height: 3rem; | ||
} | ||
|
||
.nav-item ::deep a.active { | ||
background-color: rgba(255,255,255,0.25); | ||
color: white; | ||
} | ||
|
||
.nav-item ::deep a:hover { | ||
background-color: rgba(255,255,255,0.1); | ||
color: white; | ||
} | ||
|
||
@media (min-width: 641px) { | ||
.navbar-toggler { | ||
display: none; | ||
} | ||
|
||
.collapse { | ||
/* Never collapse the sidebar for wide screens */ | ||
display: block; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
@using System.Net.Http | ||
@using System.Net.Http.Json | ||
@using Microsoft.AspNetCore.Authorization | ||
@using Microsoft.AspNetCore.Components.Authorization | ||
@using Microsoft.AspNetCore.Components.Forms | ||
@using Microsoft.AspNetCore.Components.Routing | ||
@using Microsoft.AspNetCore.Components.Web | ||
@using Microsoft.AspNetCore.Components.Web.Virtualization | ||
@using Microsoft.AspNetCore.Components.WebAssembly.Http | ||
@using Microsoft.JSInterop | ||
@using BlazorAuthClient.Client | ||
@using BlazorAuthClient.Client.Shared |
50 changes: 50 additions & 0 deletions
50
BlazorAuthClient/BlazorAuthClient/Client/wwwroot/css/app.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); | ||
|
||
html, body { | ||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | ||
} | ||
|
||
a, .btn-link { | ||
color: #0366d6; | ||
} | ||
|
||
.btn-primary { | ||
color: #fff; | ||
background-color: #1b6ec2; | ||
border-color: #1861ac; | ||
} | ||
|
||
.content { | ||
padding-top: 1.1rem; | ||
} | ||
|
||
.valid.modified:not([type=checkbox]) { | ||
outline: 1px solid #26b050; | ||
} | ||
|
||
.invalid { | ||
outline: 1px solid red; | ||
} | ||
|
||
.validation-message { | ||
color: red; | ||
} | ||
|
||
#blazor-error-ui { | ||
background: lightyellow; | ||
bottom: 0; | ||
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); | ||
display: none; | ||
left: 0; | ||
padding: 0.6rem 1.25rem 0.7rem 1.25rem; | ||
position: fixed; | ||
width: 100%; | ||
z-index: 1000; | ||
} | ||
|
||
#blazor-error-ui .dismiss { | ||
cursor: pointer; | ||
position: absolute; | ||
right: 0.75rem; | ||
top: 0.5rem; | ||
} |
Oops, something went wrong.