Skip to content

Commit

Permalink
Update standalone WASM Identity sample app (dotnet#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
guardrex authored Nov 7, 2023
1 parent 049e63e commit b0cf13d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
@using BlazorWasmAuth.Identity
@inject IAccountManagement Acct

<PageTitle>Login</PageTitle>

<h1>Login</h1>

<AuthorizeView>
<Authorized>
<div class="alert alert-success">You are logged in as @context.User.Identity?.Name.</div>
<div class="alert alert-success">You're already logged in as @context.User.Identity?.Name.</div>
</Authorized>
<NotAuthorized>
<h1>Login</h1>
@if (errors)
{
@foreach (var error in errorList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
@using BlazorWasmAuth.Identity
@inject IAccountManagement Acct

<PageTitle>Logout</PageTitle>

<h1>Logout</h1>

<AuthorizeView @ref="authView">
<Authorized>
<div class="alert alert-info">Logging you out...</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
@using BlazorWasmAuth.Identity
@inject IAccountManagement Acct

<PageTitle>Register</PageTitle>

<h1>Register</h1>

<AuthorizeView>
<Authorized>
<div class="alert alert-success">You are logged in as @context.User.Identity?.Name.</div>
<div class="alert alert-success">You're already logged in as @context.User.Identity?.Name.</div>
</Authorized>
<NotAuthorized>
<h1>Register</h1>
@if (success)
{
<div class="alert alert-success">You successfully registered. Now you can <a href="login">login</a>.</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
@attribute [Authorize]
@using System.Security.Claims

<PageTitle>Private Page</PageTitle>

<h1>Private Page</h1>

<AuthorizeView>
<p>Hello, @context.User.Identity?.Name! You are authenticated, so you can see this page that shows your claims.</p>
<p>Hello, @context.User.Identity?.Name! You're authenticated, so you can see this page that shows your claims.</p>
</AuthorizeView>

<h2>Claims</h2>
Expand Down

0 comments on commit b0cf13d

Please sign in to comment.