mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:21:10 +00:00
Implements authentication system
This commit is contained in:
1 parent
38829d64ff
commit
a6dcf65d1c
103 files changed
+2983
-454
No files matched your search
@@ -0,0 +1,27 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.UsersManagement.Authentication.Commands.ChangePassword;
|
||||
using Lumina.Contracts.Requests.Authentication;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Authentication;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="ChangePasswordRequest"/>.
|
||||
/// </summary>
|
||||
public static class ChangePasswordRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="ChangePasswordCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <returns>The converted command.</returns>
|
||||
public static ChangePasswordCommand ToCommand(this ChangePasswordRequest request)
|
||||
{
|
||||
return new ChangePasswordCommand(
|
||||
request.Username,
|
||||
request.CurrentPassword,
|
||||
request.NewPassword,
|
||||
request.NewPasswordConfirm
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.UsersManagement.Authentication.Commands.RecoverPassword;
|
||||
using Lumina.Contracts.Requests.Authentication;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Authentication;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="RecoverPasswordRequest"/>.
|
||||
/// </summary>
|
||||
public static class RecoverPasswordRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="RecoverPasswordCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <returns>The converted command.</returns>
|
||||
public static RecoverPasswordCommand ToCommand(this RecoverPasswordRequest request)
|
||||
{
|
||||
return new RecoverPasswordCommand(
|
||||
request.Username,
|
||||
request.TotpCode
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Maintenance.ApplicationSetup.Commands;
|
||||
using Lumina.Application.Core.UsersManagement.Register;
|
||||
using Lumina.Application.Core.UsersManagement.Authentication.Commands.RegisterUser;
|
||||
using Lumina.Contracts.Requests.Authentication;
|
||||
#endregion
|
||||
|
||||
@@ -27,13 +27,13 @@ public static class RegistrationRequestMapping
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="RegisterCommand"/>.
|
||||
/// Converts <paramref name="request"/> to <see cref="RegisterUserCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <returns>The converted command.</returns>
|
||||
public static RegisterCommand ToCommand(this RegistrationRequest request)
|
||||
public static RegisterUserCommand ToCommand(this RegistrationRequest request)
|
||||
{
|
||||
return new RegisterCommand(
|
||||
return new RegisterUserCommand(
|
||||
request.Username,
|
||||
request.Password,
|
||||
request.PasswordConfirm,
|
||||
|
||||
Reference in new issue
Block a user