diff --git a/WebApp/Authentication/AuthController.cs b/WebApp/Authentication/AuthController.cs index f882288..ce0cbed 100644 --- a/WebApp/Authentication/AuthController.cs +++ b/WebApp/Authentication/AuthController.cs @@ -9,7 +9,7 @@ namespace WebApp.Authentication { [HttpPost] [AllowAnonymous] - public async Task CookieLogin() + public async Task CookieLogin(string email, string password) { // Based on: https://www.codeproject.com/articles/Understanding-authentication-in-Blazor-and-ASP-NET // TODO: Fix this up diff --git a/WebApp/Components/Login.razor b/WebApp/Components/Login.razor index 1744dad..7bab714 100644 --- a/WebApp/Components/Login.razor +++ b/WebApp/Components/Login.razor @@ -2,10 +2,43 @@

Login

-
+
-
- -
\ No newline at end of file +Sign In + +@* *@ + + + +
+ + Forgot pwd? +
+ +Sign In + +@code { + string Password { get; set; } = "BMWvBPJXZu"; + + bool PasswordVisibility; + InputType PasswordInput = InputType.Password; + string PasswordInputIcon = Icons.Material.Filled.VisibilityOff; + + void TogglePasswordVisibility() + { + @if (PasswordVisibility) + { + PasswordVisibility = false; + PasswordInputIcon = Icons.Material.Filled.VisibilityOff; + PasswordInput = InputType.Password; + } + else + { + PasswordVisibility = true; + PasswordInputIcon = Icons.Material.Filled.Visibility; + PasswordInput = InputType.Text; + } + } +} \ No newline at end of file diff --git a/WebApp/Program.cs b/WebApp/Program.cs index f817e95..a9ff8ec 100644 --- a/WebApp/Program.cs +++ b/WebApp/Program.cs @@ -23,7 +23,7 @@ builder.Services.AddDatabaseDeveloperPageExceptionFilter(); builder.Services.AddScoped(); -builder.Services.AddScoped(); // Server- side +builder.Services.AddScoped(); // Server-side builder.Services.AddSingleton();//Client-side // Add authentication options @@ -59,9 +59,7 @@ app.UseAntiforgery(); app.MapRazorComponents() .AddInteractiveServerRenderMode(); -app.UseEndpoints(endpoints => -{ - endpoints.MapControllerRoute("default", "{controller}/{action}"); -}); +// Used for AuthController +app.MapControllerRoute("default", "{controller}/{action}"); app.Run();