mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Implements account registration
This commit is contained in:
1 parent
d971b53512
commit
bd97c2e8c1
13 files changed
+736
No files matched your search
@@ -0,0 +1,43 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Maintenance.ApplicationSetup.Commands;
|
||||
using Lumina.Application.Core.UsersManagement.Register;
|
||||
using Lumina.Contracts.Requests.Authentication;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.Mapping.Authentication;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for converting <see cref="RegistrationRequest"/>.
|
||||
/// </summary>
|
||||
public static class RegistrationRequestMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="SetupApplicationCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <returns>The converted command.</returns>
|
||||
public static SetupApplicationCommand ToSetupCommand(this RegistrationRequest request)
|
||||
{
|
||||
return new SetupApplicationCommand(
|
||||
request.Username,
|
||||
request.Password,
|
||||
request.PasswordConfirm,
|
||||
request.Use2fa
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts <paramref name="request"/> to <see cref="RegisterCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <returns>The converted command.</returns>
|
||||
public static RegisterCommand ToCommand(this RegistrationRequest request)
|
||||
{
|
||||
return new RegisterCommand(
|
||||
request.Username,
|
||||
request.Password,
|
||||
request.PasswordConfirm,
|
||||
request.Use2fa
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user