fixed login form

This commit is contained in:
Daniel Balk 2023-04-03 01:55:50 +02:00
parent 17a5634c42
commit 61136aee93
3 changed files with 19 additions and 1 deletions

View file

@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
namespace Moonlight.App.Models.Misc;
public class LoginDataModel
{
[Required(ErrorMessage = "You need to enter an email address")]
[EmailAddress(ErrorMessage = "You need to enter a valid email address")]
public string Email { get; set; }
[Required(ErrorMessage = "You need to enter a password")]
[MinLength(8, ErrorMessage = "You need to enter a password with minimum 8 characters in lenght")]
public string Password { get; set; }
}

View file

@ -10,6 +10,7 @@
@using Moonlight.App.Exceptions
@using Logging.Net
@using Moonlight.App.Database.Entities
@using Moonlight.App.Models.Misc
@using Moonlight.App.Services.OAuth2
@using Moonlight.App.Services.Sessions
@ -113,7 +114,7 @@
@code
{
private User User = new();
private LoginDataModel User = new();
private bool TotpRequired = false;
private string TotpCode = "";

View file

@ -421,3 +421,6 @@ If you have trouble using the QR Code, select manual input in the app and enter
Finish activation;Finish activation
New password;New password
Enable;Enable
Your account is secured with 2fa;Your account is secured with 2fa
anyone write a fancy text here?;anyone write a fancy text here?
Disable;Disable