Add initial implementation of API, database, and user management components.
This commit is contained in:
24
MikrocopApi/Mappers/AuthMappingExtensions.cs
Normal file
24
MikrocopApi/Mappers/AuthMappingExtensions.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using MikrocopApi.Dtos;
|
||||
|
||||
namespace MikrocopApi.Mappers;
|
||||
|
||||
public static class AuthMappingExtensions
|
||||
{
|
||||
public static LoginResponseDto ToDto(this (string AccessToken, DateTime ExpiresAtUtc) token)
|
||||
{
|
||||
return new LoginResponseDto
|
||||
{
|
||||
AccessToken = token.AccessToken,
|
||||
ExpiresAtUtc = token.ExpiresAtUtc,
|
||||
TokenType = "Bearer"
|
||||
};
|
||||
}
|
||||
|
||||
public static ValidatePasswordResponseDto ToDto(this bool isValid)
|
||||
{
|
||||
return new ValidatePasswordResponseDto
|
||||
{
|
||||
IsValid = isValid
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user