Skip to content
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

Fix handling incorrect login method errors #2393

Merged
merged 2 commits into from
Apr 16, 2024
Merged

Conversation

tzjames
Copy link
Collaborator

@tzjames tzjames commented Apr 16, 2024

Features and Changes

In the past whenever people logged in via email when they had already once logged in via SSO ProtectedPage handled the error via the error property on UserConext. Errors that occurred during the organization endpoint would resulting in a loading spinner forever. As part of #2339 a new modal was made to handle all errors from the organization endpoint. Unfortunately that new modal didn't have the header tab with the log out, nor enable people to log out again, and that modal took precedence over ProtectedPage, and hence people who log in via email rather than SSO when they have logged in as SSO before, can't log out again to fix the situation.

This change adds any errors that come from the organization endpoint to the error property of the UserContext and hence ProtectedPage will also show any errors there.

It also updates the message to be a clearer reminder to the user to not use email to sign in, in the case they forgot to use SSO.

Testing

In front-end/.env.local set

IS_MULTI_ORG=true
IS_CLOUD=true

In back-end/.env.local set

IS_MULTI_ORG=true
IS_CLOUD=true
SSO_CONFIG=valid SSO config

Start the server.
Login via email.
See the logout button.
Logout.
Login via SSO.
See it log in correctly.
.....
In front-end/.env.local set

IS_MULTI_ORG=false
IS_CLOUD=false

In back-end/.env.local set

LICENSE_KEY=A pro license
IS_MULTI_ORG=false
IS_CLOUD=false
SSO_CONFIG=valid SSO config

Remove any licenseKey from organization in mongo.
Start the server.
See the error message "Your license does not support SSO. Either upgrade to enterprise or remove SSO_CONFIG environment variable." also with the logout button now.

@tzjames tzjames requested a review from jdorn April 16, 2024 11:39
Copy link

Your preview environment pr-2393-bttf has been deployed.

Preview environment endpoints are available at:

@tzjames tzjames merged commit a5f5cf2 into main Apr 16, 2024
3 checks passed
@tzjames tzjames deleted the ji/wrong_login_error_handling branch April 16, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants