mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add authentication controller.
This commit is contained in:
16
Marechai.Data/Models/AuthRequest.cs
Normal file
16
Marechai.Data/Models/AuthRequest.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Models;
|
||||
|
||||
public sealed record AuthRequest
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[JsonPropertyName("email")]
|
||||
public string Email { get; set; } = null!;
|
||||
[Required]
|
||||
[DataType(DataType.Password)]
|
||||
[JsonPropertyName("password")]
|
||||
public string Password { get; set; } = null!;
|
||||
}
|
||||
13
Marechai.Data/Models/AuthResponse.cs
Normal file
13
Marechai.Data/Models/AuthResponse.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Marechai.Data.Models;
|
||||
|
||||
public sealed record AuthResponse
|
||||
{
|
||||
[JsonPropertyName("succeeded")]
|
||||
public bool Succeeded { get; set; }
|
||||
[JsonPropertyName("message")]
|
||||
public string Message { get; set; } = null!;
|
||||
[JsonPropertyName("token")]
|
||||
public string Token { get; set; } = null!;
|
||||
}
|
||||
Reference in New Issue
Block a user