Something went wrong. Try again.
because I got bored of customising my CV for every job
Something went wrong. Try again.
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107import { DomainError } from "./app-error";import { AuthenticationErrorCode } from "./error-codes";
export abstract class AuthenticationError extends DomainError {}
export class NoTokenError extends AuthenticationError { constructor() { super(AuthenticationErrorCode.NO_TOKEN, "No authentication token provided"); }}
export class InvalidCredentialsError extends AuthenticationError { constructor() { super(AuthenticationErrorCode.INVALID_CREDENTIALS, "Invalid credentials"); }}
export class InvalidTokenError extends AuthenticationError { constructor() { super(AuthenticationErrorCode.INVALID_TOKEN, "Invalid token"); }}
export class TokenExpiredError extends AuthenticationError { constructor() { super(AuthenticationErrorCode.TOKEN_EXPIRED, "Token expired"); }}
export class InvalidRefreshTokenError extends AuthenticationError { constructor() { super( AuthenticationErrorCode.INVALID_REFRESH_TOKEN, "Invalid or expired refresh token", ); }}
export class CurrentPasswordIncorrectError extends AuthenticationError { constructor() { super( AuthenticationErrorCode.CURRENT_PASSWORD_INCORRECT, "Current password is incorrect", ); }}
export class PasswordIncorrectError extends AuthenticationError { constructor() { super(AuthenticationErrorCode.PASSWORD_INCORRECT, "Password is incorrect"); }}
export class EmailAlreadyVerifiedError extends AuthenticationError { constructor() { super( AuthenticationErrorCode.EMAIL_ALREADY_VERIFIED, "Email is already verified", ); }}
export class InvalidVerificationTokenError extends AuthenticationError { constructor() { super( AuthenticationErrorCode.INVALID_VERIFICATION_TOKEN, "Invalid verification token", ); }}
export class VerificationTokenExpiredError extends AuthenticationError { constructor() { super( AuthenticationErrorCode.VERIFICATION_TOKEN_EXPIRED, "Verification token has expired", ); }}
export class InvalidPasswordResetTokenError extends AuthenticationError { constructor() { super( AuthenticationErrorCode.INVALID_PASSWORD_RESET_TOKEN, "Invalid password reset token", ); }}
export class PasswordResetTokenExpiredError extends AuthenticationError { constructor() { super( AuthenticationErrorCode.PASSWORD_RESET_TOKEN_EXPIRED, "Password reset token has expired", ); }}
export class EmailNotVerifiedError extends AuthenticationError { constructor() { super( AuthenticationErrorCode.EMAIL_NOT_VERIFIED, "Email address has not been verified. Please check your email and verify your account before logging in.", ); }}