Skip to content

Commit c7f05f0

Browse files
committed
flow type
1 parent d16fe23 commit c7f05f0

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/Options/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ type EmailVerificationRequest = {
5555
},
5656
resendRequest?: boolean,
5757
};
58+
type SendEmailVerificationRequest = {
59+
user: any,
60+
master?: boolean,
61+
};
5862

5963
export interface ParseServerOptions {
6064
/* Your Parse Application ID
@@ -233,7 +237,10 @@ export interface ParseServerOptions {
233237
Default is `true`.
234238
<br>
235239
:DEFAULT: true */
236-
sendUserEmailVerification: ?(boolean | void);
240+
sendUserEmailVerification: ?(
241+
| boolean
242+
| (SendEmailVerificationRequest => boolean | Promise<boolean>)
243+
);
237244
/* The account lockout policy for failed login attempts. */
238245
accountLockout: ?AccountLockoutOptions;
239246
/* The password policy for enforcing password related rules. */

types/Options/index.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export interface VerifyUserEmailsRequest {
3838
};
3939
resendRequest?: boolean;
4040
}
41+
export interface SendEmailVerificationRequest {
42+
user: any;
43+
master?: boolean;
44+
}
4145
export interface ParseServerOptions {
4246
appId: string;
4347
masterKey: (() => void) | string;
@@ -91,7 +95,7 @@ export interface ParseServerOptions {
9195
preventSignupWithUnverifiedEmail?: boolean;
9296
emailVerifyTokenValidityDuration?: number;
9397
emailVerifyTokenReuseIfValid?: boolean;
94-
sendUserEmailVerification?: (boolean | void);
98+
sendUserEmailVerification?: boolean | ((params: SendEmailVerificationRequest) => boolean | Promise<boolean>);
9599
accountLockout?: AccountLockoutOptions;
96100
passwordPolicy?: PasswordPolicyOptions;
97101
cacheAdapter?: Adapter<CacheAdapter>;

0 commit comments

Comments
 (0)