29 lines
1.2 KiB
C#
29 lines
1.2 KiB
C#
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));
|
|
}
|
|
} |