mirror of
https://github.com/claunia/marechai.git
synced 2026-07-08 17:57:08 +00:00
- Added two-factor authentication support in the login process, including handling for two-factor tokens and available methods. - Enhanced the login page to manage two-factor verification and recovery codes. - Introduced a security tab in the user profile for managing two-factor authentication settings, including enabling/disabling authenticator and email methods. - Implemented backend services for managing two-factor authentication, including enabling/disabling methods and regenerating recovery codes. - Added admin functionality to disable two-factor authentication for users. - Updated UI components to reflect changes in two-factor authentication status and provide user feedback. - Configured SMTP settings for email notifications related to two-factor authentication.
27 lines
958 B
C#
27 lines
958 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Marechai.Data.Models;
|
|
|
|
/// <summary>
|
|
/// Submits a TOTP authenticator-app or email second-factor code together with the short-lived pending-2FA
|
|
/// JWT obtained from the password step. On success the server returns a final API JWT.
|
|
/// </summary>
|
|
public sealed record TwoFactorVerifyRequest
|
|
{
|
|
/// <summary>The pending-2FA token returned by <c>POST /auth/login</c>.</summary>
|
|
[Required]
|
|
[JsonPropertyName("twoFactorToken")]
|
|
public string TwoFactorToken { get; set; } = null!;
|
|
|
|
/// <summary>One of <c>"authenticator"</c> or <c>"email"</c>.</summary>
|
|
[Required]
|
|
[JsonPropertyName("provider")]
|
|
public string Provider { get; set; } = null!;
|
|
|
|
/// <summary>The 6-digit code from the authenticator app or the email message.</summary>
|
|
[Required]
|
|
[JsonPropertyName("code")]
|
|
public string Code { get; set; } = null!;
|
|
}
|