-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
preventLoginWithUnverifiedEmail does not prevent auto login after signup #4142
Comments
with the fix that is landed, the user is still returned to the client without creating a session token. to create the behavior that we want, we still need to log the user out on the client-side after signup to clean the cache regarding user information. |
You don’t need to log the user out, actually, your signup call succeeds as a user is effectively created in the database, what do you expect? Can you provide an example of the usage you’d like to have? |
@flovilmart remember what we discussed? I think this is exactly the case I told you. @tolgaatam instead of checking for a current user, the client needs to check if the current user has a |
Yep, but there’s no way to make the call looks like the signup is OK, (because it is) and that an authenticated user is not the current one without rewriting all SDK’s. If one tries to save the current user, this will fail, because there’s no session token, so fall back to a login/ signup flow. I don’t believe we should change anything in the SDK’s, as there’s an obvious way to check he state. |
@flovilmart totally agree with you here. Therefore, we need to document the need to check for |
Yep! |
Closing as PR is merged. |
Issue Description
preventLoginWithUnverifiedEmail and verifyUserEmails flags set to true together do not prevent auto login after signup which bypasses the security measures
Steps to reproduce
Create a parse server application on local/remote server. set options preventLoginWithUnverifiedEmail and verifyUserEmails options to true and supply a working email adapter.
Create a test client and send a valid signup request. Check sessions to see if a session is created for the user
Expected Results
Expected is that the user is not ever allowed to login before verifying the email. Hence, a session should not be created for the user until emailVerified field of the user is set true.
Actual Outcome
For the first time, the user is logged in automatically to the system after signup. Consecutive manual logins fail with an error message indicating the lack of email verification, as expected.
Environment Setup
Server
Database
Logs/Trace
The text was updated successfully, but these errors were encountered: