Disable password reset and hide login form with SSO #8467
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR does two things if SSO is enabled:
WAGTAIL_PASSWORD_RESET_ENABLED
setting) and removes our password reset override templateThe second is accomplished by checking if a GET parameter (
others
) is provided when SSO is enabled, and if it is not, overriding the Wagtail login page'slogin_form
andsubmit_buttons
blocks.How to test this PR
Test without SSO enabled and ensure the login form displays correctly as usual, and the "Forgot password" link is available.
Set the SSO environment variables listed in
.env_SAMPLE
. A test OIDC provider is not required for the login page to show the SSO button, and for the functionality of the "Other ways to sign in" link to be tested, but the values have to be defined for the site to run.Visit https://localhost:8000/admin
Observe the username/password form is not displayed
Click the "Other ways to sign in" link
Observe the username/password form is displayed
Observe that the "Forgot password" link is not shown
Screenshots
Checklist