Backend login and register
This commit is contained in:
29
src/Application/Errors/AuthError.cs
Normal file
29
src/Application/Errors/AuthError.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Application.Common.Results;
|
||||
|
||||
namespace Application.Errors;
|
||||
|
||||
public static class AuthError
|
||||
{
|
||||
public static Error InvalidRegisterRequest => new(ErrorTypeConstant.ValidationError, "Invalid register request");
|
||||
|
||||
public static Error EmailAlreadyExists => new(ErrorTypeConstant.ValidationError, "E-Mail already exists");
|
||||
|
||||
public static Error UsernameAlreadyExists => new(ErrorTypeConstant.ValidationError, "Username already exists");
|
||||
public static Error InvalidLoginRequest => new(ErrorTypeConstant.ValidationError, "Invalid login request");
|
||||
|
||||
public static Error UserNotFound => new(ErrorTypeConstant.NotFound, "User not found");
|
||||
|
||||
public static Error InvalidPassword => new(ErrorTypeConstant.ValidationError, "Invalid Password");
|
||||
public static Error InvalidResetLink => new(ErrorTypeConstant.ValidationError, "Invalid reset link");
|
||||
|
||||
|
||||
public static Error CreateInvalidLoginRequestError(IEnumerable<string> errors)
|
||||
{
|
||||
return new Error(ErrorTypeConstant.ValidationError, string.Join(", ", errors));
|
||||
}
|
||||
|
||||
public static Error CreateInvalidRegisterRequestError(IEnumerable<string> errors)
|
||||
{
|
||||
return new Error(ErrorTypeConstant.ValidationError, string.Join(", ", errors));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user