You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Two factor options passed down to the @accounts/two-factor service.
51
51
*/
52
52
twoFactor?: AccountsTwoFactorOptions;
53
+
/**
54
+
* Whether the email needs to be verified in order to allow authentication.
55
+
* From an user enumeration perspective changes what is safe to return when ambiguousErrorMessages are enabled.
56
+
* Can be enabled only if enableAutologin is set to false.
57
+
* Defaults to false.
58
+
*/
59
+
requireEmailVerification?: boolean;
53
60
/**
54
61
* The number of milliseconds from when a link to verify the user email is sent until token expires and user can't verify his email with the link anymore.
"Can't enable autologin when requireEmailVerification is enabled. Please set either of them to false."
212
+
);
213
+
}
214
+
// AccountsPassword has been manually instantiated so there is no way to access the AccountsServer options
215
+
if(!server){
216
+
console.log(
217
+
"Please ensure that 'enableAutologin' has not been set to true in AccountsServer."
218
+
);
219
+
}
220
+
}
221
+
200
222
this.twoFactor=newTwoFactor(options.twoFactor);
201
223
if(db){
202
224
this.db=db;
@@ -716,6 +738,19 @@ export default class AccountsPassword<CustomUser extends User = User>
716
738
);
717
739
}
718
740
}
741
+
if(this.options.requireEmailVerification){
742
+
// If the user logs in using the email it must be a verified address, if he provided an username at least one of the associated emails must be verified.
0 commit comments