feat: add LoginRequest and LoginResponse DTOs
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace ROLAC.API.DTOs.Auth;
|
||||||
|
|
||||||
|
public class LoginRequest
|
||||||
|
{
|
||||||
|
[Required]
|
||||||
|
[EmailAddress]
|
||||||
|
[MaxLength(256)]
|
||||||
|
public string Email { get; set; } = null!;
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
[MinLength(8)]
|
||||||
|
[MaxLength(128)]
|
||||||
|
public string Password { get; set; } = null!;
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
namespace ROLAC.API.DTOs.Auth;
|
||||||
|
|
||||||
|
public class LoginResponse
|
||||||
|
{
|
||||||
|
/// <summary>Short-lived JWT (15 min). Store in memory — never in localStorage.</summary>
|
||||||
|
public string AccessToken { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>Seconds until the access token expires. Always 900 (15 × 60).</summary>
|
||||||
|
public int ExpiresIn { get; set; }
|
||||||
|
|
||||||
|
public UserInfo User { get; set; } = null!;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserInfo
|
||||||
|
{
|
||||||
|
public string Id { get; set; } = null!;
|
||||||
|
public string Email { get; set; } = null!;
|
||||||
|
public IList<string> Roles { get; set; } = [];
|
||||||
|
public string LanguagePreference { get; set; } = "en";
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user