Add authentication controller.

This commit is contained in:
2025-11-13 17:04:00 +00:00
parent d0e5725ae0
commit 349b396588
4 changed files with 86 additions and 0 deletions

View 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!;
}

View 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!;
}