import { DomainError } from "@cv/system"; export abstract class AuthenticationError extends DomainError {} export class NoTokenError extends AuthenticationError { constructor() { super("AUTHENTICATION_NO_TOKEN", "No authentication token provided"); } } export class InvalidCredentialsError extends AuthenticationError { constructor() { super("AUTHENTICATION_INVALID_CREDENTIALS", "Invalid credentials"); } } export class InvalidTokenError extends AuthenticationError { constructor() { super("AUTHENTICATION_INVALID_TOKEN", "Invalid token"); } } export class TokenExpiredError extends AuthenticationError { constructor() { super("AUTHENTICATION_TOKEN_EXPIRED", "Token expired"); } } export class InvalidRefreshTokenError extends AuthenticationError { constructor() { super( "AUTHENTICATION_INVALID_REFRESH_TOKEN", "Invalid or expired refresh token", ); } } export class CurrentPasswordIncorrectError extends AuthenticationError { constructor() { super( "AUTHENTICATION_CURRENT_PASSWORD_INCORRECT", "Current password is incorrect", ); } } export class PasswordIncorrectError extends AuthenticationError { constructor() { super("AUTHENTICATION_PASSWORD_INCORRECT", "Password is incorrect"); } } export class EmailAlreadyVerifiedError extends AuthenticationError { constructor() { super("AUTHENTICATION_EMAIL_ALREADY_VERIFIED", "Email is already verified"); } } export class InvalidVerificationTokenError extends AuthenticationError { constructor() { super( "AUTHENTICATION_INVALID_VERIFICATION_TOKEN", "Invalid verification token", ); } } export class VerificationTokenExpiredError extends AuthenticationError { constructor() { super( "AUTHENTICATION_VERIFICATION_TOKEN_EXPIRED", "Verification token has expired", ); } } export class InvalidPasswordResetTokenError extends AuthenticationError { constructor() { super( "AUTHENTICATION_INVALID_PASSWORD_RESET_TOKEN", "Invalid password reset token", ); } } export class PasswordResetTokenExpiredError extends AuthenticationError { constructor() { super( "AUTHENTICATION_PASSWORD_RESET_TOKEN_EXPIRED", "Password reset token has expired", ); } } export class EmailNotVerifiedError extends AuthenticationError { constructor() { super( "AUTHENTICATION_EMAIL_NOT_VERIFIED", "Email address has not been verified", ); } }