Add auth controller/DTOs and update seed password
Introduce authentication API: add AuthController with login, logout and me endpoints using SignInManager/UserManager; add LoginRequest and CurrentUserResponse DTOs. Login enforces active users, updates UpdatedAt on success, and returns localized messages. Also change default seed admin password from "Hoard" to "HoardPassword".
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
namespace API.Contracts.Auth
|
||||
{
|
||||
public class CurrentUserResponse
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public bool IsAdmin { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public bool MustChangePassword { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace API.Contracts.Auth
|
||||
{
|
||||
public class LoginRequest
|
||||
{
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user