Merge pull request #20 from Moonlight-Panel/LoginFormFix
fixed login form
This commit is contained in:
14
Moonlight/App/Models/Misc/LoginDataModel.cs
Normal file
14
Moonlight/App/Models/Misc/LoginDataModel.cs
Normal 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; }
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
@using Moonlight.App.Exceptions
|
@using Moonlight.App.Exceptions
|
||||||
@using Logging.Net
|
@using Logging.Net
|
||||||
@using Moonlight.App.Database.Entities
|
@using Moonlight.App.Database.Entities
|
||||||
|
@using Moonlight.App.Models.Misc
|
||||||
@using Moonlight.App.Services.OAuth2
|
@using Moonlight.App.Services.OAuth2
|
||||||
@using Moonlight.App.Services.Sessions
|
@using Moonlight.App.Services.Sessions
|
||||||
|
|
||||||
@@ -113,7 +114,7 @@
|
|||||||
|
|
||||||
@code
|
@code
|
||||||
{
|
{
|
||||||
private User User = new();
|
private LoginDataModel User = new();
|
||||||
|
|
||||||
private bool TotpRequired = false;
|
private bool TotpRequired = false;
|
||||||
private string TotpCode = "";
|
private string TotpCode = "";
|
||||||
|
|||||||
@@ -421,3 +421,6 @@ If you have trouble using the QR Code, select manual input in the app and enter
|
|||||||
Finish activation;Finish activation
|
Finish activation;Finish activation
|
||||||
New password;New password
|
New password;New password
|
||||||
Enable;Enable
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user