mirror of
https://github.com/gaseous-project/gaseous-server
synced 2026-04-21 21:37:17 +00:00
Introduce the gaseous library and process host projects, enabling out-of-process execution and enhancing task management. Implemented versioning support for AgeGroupMap downloads and improved status reporting for background tasks. Refactored various components for better integration and error handling. Updated configurations for inter-process communication and task initialization.
128 lines
3.9 KiB
C#
128 lines
3.9 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Authentication
|
|
{
|
|
public class ExternalLoginConfirmationViewModel
|
|
{
|
|
[Required]
|
|
[EmailAddress]
|
|
[Display(Name = "Email")]
|
|
public string Email { get; set; }
|
|
}
|
|
|
|
public class ManageUserViewModel
|
|
{
|
|
[Required]
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Current password")]
|
|
public string OldPassword { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "New password")]
|
|
public string NewPassword { get; set; }
|
|
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Confirm new password")]
|
|
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
|
|
public string ConfirmPassword { get; set; }
|
|
}
|
|
|
|
public class LoginViewModel
|
|
{
|
|
[Required]
|
|
[Display(Name = "Email or Username")]
|
|
public string Email { get; set; }
|
|
|
|
[Required]
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Password")]
|
|
public string Password { get; set; }
|
|
|
|
[Display(Name = "Remember me?")]
|
|
public bool RememberMe { get; set; }
|
|
}
|
|
|
|
public class RegisterViewModel
|
|
{
|
|
[Required]
|
|
[DataType(DataType.Text)]
|
|
[Display(Name = "User name")]
|
|
public string UserName { get; set; }
|
|
|
|
[Required]
|
|
[EmailAddress]
|
|
[Display(Name = "Email")]
|
|
public string Email { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Password")]
|
|
public string Password { get; set; }
|
|
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Confirm password")]
|
|
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
|
|
public string ConfirmPassword { get; set; }
|
|
}
|
|
|
|
public class ResetPasswordViewModel
|
|
{
|
|
[Required]
|
|
[EmailAddress]
|
|
[Display(Name = "Email")]
|
|
public string Email { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Password")]
|
|
public string Password { get; set; }
|
|
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "Confirm password")]
|
|
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
|
|
public string ConfirmPassword { get; set; }
|
|
|
|
public string Code { get; set; }
|
|
}
|
|
|
|
public class ForgotPasswordViewModel
|
|
{
|
|
[Required]
|
|
[EmailAddress]
|
|
[Display(Name = "Email")]
|
|
public string Email { get; set; }
|
|
}
|
|
|
|
public class ChangeUsernameViewModel
|
|
{
|
|
[Required]
|
|
[StringLength(30, MinimumLength = 3, ErrorMessage = "The {0} must be between {2} and {1} characters long.")]
|
|
[RegularExpression("^[A-Za-z0-9_.@-]+$", ErrorMessage = "Only letters, numbers, underscores (_), dashes (-), periods (.), and at signs (@) are allowed.")]
|
|
[Display(Name = "New user name")]
|
|
public string NewUserName { get; set; }
|
|
}
|
|
|
|
public class TwoFactorVerifyViewModel
|
|
{
|
|
[Required]
|
|
[Display(Name = "Authenticator code")]
|
|
public string Code { get; set; }
|
|
|
|
[Display(Name = "Remember me?")]
|
|
public bool RememberMe { get; set; }
|
|
|
|
[Display(Name = "Remember this device")]
|
|
public bool RememberMachine { get; set; }
|
|
}
|
|
|
|
public class TwoFactorRecoveryViewModel
|
|
{
|
|
[Required]
|
|
[Display(Name = "Recovery code")]
|
|
public string RecoveryCode { get; set; }
|
|
}
|
|
}
|