-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Adds ability to prevent login with unverified emails #2175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds ability to prevent login with unverified emails #2175
Conversation
@flovilmart |
@@ -209,6 +209,8 @@ var server = ParseServer({ | |||
...otherOptions, | |||
// Enable email verification | |||
verifyUserEmails: true, | |||
// prevent login with unverified email | |||
preventLoginWithUnverifiedEmail: true, // defaults to false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd put false in the readme, as it's the default value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Can you add a test that would ensure a user with verifiedEmail == true can login correctly? |
@flovilmart |
@cherukumilli updated the pull request. |
1 similar comment
@cherukumilli updated the pull request. |
This looks good to me |
This is an update based on the feedback from #2165
Adds a new config variable
psuedo code for usage of new config variable:
preventLoginWithUnverifiedEmail
If
preventLoginWithUnverifiedEmail
istrue
andverifyUserEmails
istrue
andemailVerified
isfalse
then
/login
will fail with the following error
User email is not verified
.This code is completely backward compatible and will not break any of the existing code.
Adds 3 new test cases
preventLoginWithUnverifiedEmai
is set totrue
preventLoginWithUnverifiedEmail
is set totrue
preventLoginWithUnverifiedEmail
is set tofalse
Updated README file
The following shows how to use the new config parameter (
preventLoginWithUnverifiedEmail
)Please let me know if you need any more info in the PR to help merge it.