- Add DTOs: RegisterDto, LoginDto, AuthResponse - Add IAuthService interface - Implement AuthService with JWT token generation - Create AuthController with register, login, me endpoints - Add JWT configuration to appsettings.json - Configure JWT Bearer authentication in Program.cs - Add PasswordHasher for custom User entity - Update User entity with ChangePassword method - Add necessary NuGet packages for JWT auth Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
13 lines
412 B
C#
13 lines
412 B
C#
namespace GermanApp.Application.DTOs.Auth;
|
|
|
|
/// <summary>
|
|
/// DTO for authentication response containing JWT token.
|
|
/// </summary>
|
|
public record AuthResponse
|
|
{
|
|
public int UserId { get; init; }
|
|
public string Username { get; init; } = string.Empty;
|
|
public string Email { get; init; } = string.Empty;
|
|
public string Token { get; init; } = string.Empty;
|
|
public DateTime ExpiresAt { get; init; }
|
|
}
|