feat: Add event information to verifyUserEmails, preventLoginWithUnverifiedEmail to identify invoking signup / login action and auth provider (#9963)

This commit is contained in:
Palixir
2026-02-06 04:48:35 +01:00
committed by GitHub
parent 617de9989b
commit ed98c15f90
12 changed files with 350 additions and 27 deletions

View File

@@ -26,6 +26,22 @@ type RequestKeywordDenylist = {
key: string;
value: any;
};
export interface EmailVerificationRequest {
original?: any;
object: any;
master?: boolean;
ip?: string;
installationId?: string;
createdWith?: {
action: 'login' | 'signup';
authProvider: string;
};
resendRequest?: boolean;
}
export interface SendEmailVerificationRequest {
user: any;
master?: boolean;
}
export interface ParseServerOptions {
appId: string;
masterKey: (() => void) | string;
@@ -74,12 +90,12 @@ export interface ParseServerOptions {
auth?: Record<string, AuthAdapter>;
enableInsecureAuthAdapters?: boolean;
maxUploadSize?: string;
verifyUserEmails?: (boolean | void);
preventLoginWithUnverifiedEmail?: boolean;
verifyUserEmails?: boolean | ((params: EmailVerificationRequest) => boolean | Promise<boolean>);
preventLoginWithUnverifiedEmail?: boolean | ((params: EmailVerificationRequest) => boolean | Promise<boolean>);
preventSignupWithUnverifiedEmail?: boolean;
emailVerifyTokenValidityDuration?: number;
emailVerifyTokenReuseIfValid?: boolean;
sendUserEmailVerification?: (boolean | void);
sendUserEmailVerification?: boolean | ((params: SendEmailVerificationRequest) => boolean | Promise<boolean>);
accountLockout?: AccountLockoutOptions;
passwordPolicy?: PasswordPolicyOptions;
cacheAdapter?: Adapter<CacheAdapter>;