mirror of
https://github.com/documenso/documenso.git
synced 2026-06-22 04:12:06 +10:00
7e8da85bd8
Reject disposable / throwaway email providers (mailinator, yopmail, 10minutemail, ...) across all signup paths: email/password, Google, Microsoft, personal OIDC and organisation OIDC. Backed by the mailchecker package (offline, ~55k domains, subdomain-aware). Exposes a SIGNUP_DISPOSABLE_EMAIL error code so the signup form and SSO redirect alert can show a dedicated message instead of the generic 'signup disabled' one.
32 lines
1.3 KiB
TypeScript
32 lines
1.3 KiB
TypeScript
export const AuthenticationErrorCode = {
|
|
AccountDisabled: 'ACCOUNT_DISABLED',
|
|
Unauthorized: 'UNAUTHORIZED',
|
|
InvalidCredentials: 'INVALID_CREDENTIALS',
|
|
SessionNotFound: 'SESSION_NOT_FOUND',
|
|
SessionExpired: 'SESSION_EXPIRED',
|
|
InvalidToken: 'INVALID_TOKEN',
|
|
MissingToken: 'MISSING_TOKEN',
|
|
InvalidRequest: 'INVALID_REQUEST',
|
|
UnverifiedEmail: 'UNVERIFIED_EMAIL',
|
|
NotFound: 'NOT_FOUND',
|
|
NotSetup: 'NOT_SETUP',
|
|
|
|
// InternalSeverError: 'INTERNAL_SEVER_ERROR',
|
|
// TwoFactorAlreadyEnabled: 'TWO_FACTOR_ALREADY_ENABLED',
|
|
// TwoFactorSetupRequired: 'TWO_FACTOR_SETUP_REQUIRED',
|
|
// TwoFactorMissingSecret: 'TWO_FACTOR_MISSING_SECRET',
|
|
// TwoFactorMissingCredentials: 'TWO_FACTOR_MISSING_CREDENTIALS',
|
|
InvalidTwoFactorCode: 'INVALID_TWO_FACTOR_CODE',
|
|
SignupDisabled: 'SIGNUP_DISABLED',
|
|
SignupDisposableEmail: 'SIGNUP_DISPOSABLE_EMAIL',
|
|
// IncorrectTwoFactorBackupCode: 'INCORRECT_TWO_FACTOR_BACKUP_CODE',
|
|
// IncorrectIdentityProvider: 'INCORRECT_IDENTITY_PROVIDER',
|
|
// IncorrectPassword: 'INCORRECT_PASSWORD',
|
|
// MissingEncryptionKey: 'MISSING_ENCRYPTION_KEY',
|
|
// MissingBackupCode: 'MISSING_BACKUP_CODE',
|
|
} as const;
|
|
|
|
export type AuthenticationErrorCode =
|
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
(typeof AuthenticationErrorCode)[keyof typeof AuthenticationErrorCode] | (string & {});
|