-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Lan2Play/feature/AuthRework
Rework auth
- Loading branch information
Showing
93 changed files
with
716 additions
and
2,333 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,3 @@ | |
<h1>Hello, world!</h1> | ||
|
||
Welcome to your new app. | ||
|
||
<SurveyPrompt Title="How is Blazor working for you?" /> |
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,17 @@ | ||
@page "/login" | ||
|
||
<h3>Login</h3> | ||
|
||
<EditForm Model="LoginRequest" OnValidSubmit="ExecuteLogin"> | ||
<DataAnnotationsValidator /> | ||
<MudCard > | ||
<MudCardContent> | ||
<MudTextField id="Input.Email" Label="Email" @bind-Value="LoginRequest.UserName" For="@(() => LoginRequest.UserName)" /> | ||
<MudTextField id="Input.Password" Label="Password" @bind-Value="LoginRequest.Password" For="@(() => LoginRequest.Password)" InputType="InputType.Password" /> | ||
<MudCheckBox id="Input.Remember" Label="Remember Me" @bind-Checked="LoginRequest.RememberMe" /> | ||
</MudCardContent> | ||
<MudCardActions> | ||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Outlined" Color="Color.Primary" Class="ma-2 py-2">Login</MudButton> | ||
</MudCardActions> | ||
</MudCard> | ||
</EditForm> |
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,43 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using NetEvent.Client.Services; | ||
using NetEvent.Shared.Dto; | ||
|
||
namespace NetEvent.Client.Pages | ||
{ | ||
public partial class Login | ||
{ | ||
[Inject] | ||
public CustomStateProvider AuthenticationStateProvider { get; set; } | ||
|
||
[Inject] | ||
public NavigationManager NavigationManager { get; set; } | ||
|
||
|
||
public LoginRequest LoginRequest { get; set; } = new (); | ||
|
||
|
||
public string Error { get; set; } | ||
|
||
|
||
protected override async Task OnAfterRenderAsync(bool firstRender) | ||
{ | ||
if (firstRender) | ||
{ | ||
|
||
} | ||
} | ||
|
||
public async Task ExecuteLogin() | ||
{ | ||
try | ||
{ | ||
await AuthenticationStateProvider.Login(LoginRequest); | ||
NavigationManager.NavigateTo(""); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Error = ex.Message; | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.