-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c772cf
commit a17e384
Showing
16 changed files
with
46 additions
and
141 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[*.{cs,vb}] | ||
|
||
# IDE0130: Namespace does not match folder structure | ||
dotnet_diagnostic.IDE0130.severity = none |
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
11 changes: 11 additions & 0 deletions
11
sample/SampleBlazorApp/SampleBlazorApp.Client/Components/Redirect.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@inject NavigationManager NavigationManager | ||
|
||
@code { | ||
|
||
[Parameter, EditorRequired] public required string To { get; set; } | ||
|
||
protected override void OnInitialized() | ||
{ | ||
NavigationManager.NavigateTo(To); | ||
} | ||
} |
8 changes: 0 additions & 8 deletions
8
sample/SampleBlazorApp/SampleBlazorApp.Client/Components/RedirectToHome.razor
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
sample/SampleBlazorApp/SampleBlazorApp.Client/Components/RedirectToSignIn.razor
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
sample/SampleBlazorApp/SampleBlazorApp.Client/Components/RouteAuthorize.razor
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
public class SignInPayload | ||
{ | ||
public string MyData { get; set; } = "Some data"; | ||
} |
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
public class SignUpPayload | ||
{ | ||
public string MyData { get; set; } = "Some data"; | ||
} |
9 changes: 3 additions & 6 deletions
9
sample/SampleBlazorApp/SampleBlazorApp.Client/Pages/AuthPage.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
12 changes: 2 additions & 10 deletions
12
sample/SampleBlazorApp/SampleBlazorApp.Client/Pages/AuthRequiredPage.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,18 +1,10 @@ | ||
@page "/auth-required" | ||
@inherits PageBase | ||
@attribute [Authorize] | ||
|
||
@using System.Text.Json | ||
|
||
<PageTitle>Auth Required</PageTitle> | ||
<PageTitle>Auth Required Page | Blazor.Auth</PageTitle> | ||
|
||
<h1>Auth Required</h1> | ||
|
||
<AuthorizeView> | ||
<pre> | ||
@JsonSerializer.Serialize(@context | ||
.User.Claims.Select(x => new | ||
{ x.Type, x.Value, x.Issuer, x.Subject?.Name, x.ValueType } | ||
), new JsonSerializerOptions { WriteIndented = true }) | ||
</pre> | ||
</AuthorizeView> | ||
You are authorized! |
18 changes: 0 additions & 18 deletions
18
sample/SampleBlazorApp/SampleBlazorApp.Client/Pages/Base/PageBase.cs
This file was deleted.
Oops, something went wrong.
3 changes: 1 addition & 2 deletions
3
sample/SampleBlazorApp/SampleBlazorApp.Client/Pages/HomePage.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
15 changes: 1 addition & 14 deletions
15
sample/SampleBlazorApp/SampleBlazorApp.Client/Pages/SignOutPage.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,25 +1,12 @@ | ||
@page "/sign-out" | ||
@inherits PageBase | ||
|
||
@inject NavigationManager NavigationManager | ||
@inject IUserService UserService | ||
|
||
<PageTitle>Sign Out</PageTitle> | ||
|
||
<h1>Sign Out</h1> | ||
|
||
<div> | ||
<div> | ||
<button type="submit" class="btn btn-lg btn-primary" @onclick="SignOutAsync">Sign Out</button> | ||
</div> | ||
</div> | ||
|
||
|
||
@code { | ||
private async Task SignOutAsync() | ||
protected override async Task OnInitializedAsync() | ||
{ | ||
await UserService.SignOutAsync(); | ||
|
||
NavigationManager.NavigateTo("/", true); | ||
} | ||
} |
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,8 +1,14 @@ | ||
using BitzArt.Blazor.Auth; | ||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | ||
|
||
var builder = WebAssemblyHostBuilder.CreateDefault(args); | ||
internal class Program | ||
{ | ||
private static async Task Main(string[] args) | ||
{ | ||
var builder = WebAssemblyHostBuilder.CreateDefault(args); | ||
|
||
builder.AddBlazorAuth(); | ||
builder.AddBlazorAuth(); | ||
|
||
await builder.Build().RunAsync(); | ||
await builder.Build().RunAsync(); | ||
} | ||
} |
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