diff --git a/Moonlight/App/Models/Misc/LoginDataModel.cs b/Moonlight/App/Models/Forms/LoginDataModel.cs similarity index 92% rename from Moonlight/App/Models/Misc/LoginDataModel.cs rename to Moonlight/App/Models/Forms/LoginDataModel.cs index d6c00204..63a5ac28 100644 --- a/Moonlight/App/Models/Misc/LoginDataModel.cs +++ b/Moonlight/App/Models/Forms/LoginDataModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Moonlight.App.Models.Misc; +namespace Moonlight.App.Models.Forms; public class LoginDataModel { diff --git a/Moonlight/App/Models/Forms/LoginTotpDataModel.cs b/Moonlight/App/Models/Forms/LoginTotpDataModel.cs new file mode 100644 index 00000000..b1dcca02 --- /dev/null +++ b/Moonlight/App/Models/Forms/LoginTotpDataModel.cs @@ -0,0 +1,9 @@ +using System.ComponentModel.DataAnnotations; + +namespace Moonlight.App.Models.Forms; + +public class LoginTotpDataModel +{ + [Required(ErrorMessage = "You need to enter a 2fa code")] + public string Code { get; set; } = ""; +} \ No newline at end of file diff --git a/Moonlight/Shared/Components/Auth/Login.razor b/Moonlight/Shared/Components/Auth/Login.razor index 28ca0ce0..dd642e39 100644 --- a/Moonlight/Shared/Components/Auth/Login.razor +++ b/Moonlight/Shared/Components/Auth/Login.razor @@ -13,6 +13,8 @@ @using Moonlight.App.Models.Misc @using Moonlight.App.Services.OAuth2 @using Moonlight.App.Services.Sessions +@using System.ComponentModel.DataAnnotations +@using Moonlight.App.Models.Forms @inject AlertService AlertService @inject UserService UserService @@ -26,9 +28,9 @@