Refactoring, database structure changed
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using WatchIt.Database.Model.Accounts;
|
||||
|
||||
namespace WatchIt.DTO.Models.Controllers.Authentication;
|
||||
|
||||
public static class AuthenticationMappers
|
||||
{
|
||||
#region Authentication
|
||||
|
||||
public static AuthenticationResponse CreateAuthenticationResponse(string accessToken, string refreshToken) => new AuthenticationResponse
|
||||
{
|
||||
AccessToken = accessToken,
|
||||
RefreshToken = refreshToken,
|
||||
};
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace WatchIt.DTO.Models.Controllers.Authentication;
|
||||
|
||||
public class AuthenticationRefreshRequest
|
||||
{
|
||||
public string AccessToken { get; set; } = null!;
|
||||
public string RefreshToken { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace WatchIt.DTO.Models.Controllers.Authentication;
|
||||
|
||||
public class AuthenticationRequest
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public string UsernameOrEmail { get; set; } = null!;
|
||||
public string Password { get; set; } = null!;
|
||||
public bool RememberMe { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace WatchIt.DTO.Models.Controllers.Authentication;
|
||||
|
||||
public class AuthenticationRequestValidator : AbstractValidator<AuthenticationRequest>
|
||||
{
|
||||
public AuthenticationRequestValidator()
|
||||
{
|
||||
RuleFor(x => x.UsernameOrEmail).NotEmpty();
|
||||
RuleFor(x => x.Password).NotEmpty();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace WatchIt.DTO.Models.Controllers.Authentication;
|
||||
|
||||
public class AuthenticationResponse
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public string AccessToken { get; init; } = null!;
|
||||
public string RefreshToken { get; init; } = null!;
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user