Skip to content

fix(WISEAuthenticationSuccessHandler): Signing in to a closed site redirects to a page that does not exist - #369

Merged
hirokiterashima merged 1 commit into
WISE-Community:developfrom
Isaries:fix/closed-site-refusal-json
Nov 25, 2026
Merged

hirokiterashima merged 1 commit into
WISE-Community:developfrom
Isaries:fix/closed-site-refusal-json

Conversation

@Isaries

@Isaries Isaries commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

When an administrator disables sign-in (isLoginAllowed: false in the portal settings), a teacher or student who signs in with the correct password is told "Username and password not recognized". WISEAuthenticationSuccessHandler signs the person out again and redirects to /pages/maintenance.html (LOGIN_DISABLED_MESSGE_PAGE), but that page has never existed in this repository. The sign-in page posts the credentials with XHR, follows the redirect, cannot read what comes back, and falls through to the wrong-password message.

The effect is that, while the site is closed, people who type the right password are told it is wrong, and may reset passwords or contact their teacher instead of waiting.

Changes

  • The refusal is a JSON body built with ControllerUtil.createErrorResponse() and isLoginDisabled: true, the same shape WISEAuthenticationFailureHandler uses for isRecaptchaVerificationFailed.
  • The unused LOGIN_DISABLED_MESSGE_PAGE constant is removed.

The sign-in page needs to recognise isLoginDisabled to show a message instead of the password error; that is WISE-Client#2381.

Test

  • New WISEAuthenticationSuccessHandlerTest: a student signing in to a closed site gets no redirect, a body with status: "error" and isLoginDisabled: true, and an empty security context. Against the current develop it fails with expected: <null> but was: </pages/maintenance.html>.
  • WISEAuthenticationSuccessHandlerTest, WebSecurityConfigAuthorizationTest and LoginControllerTest pass.

…directs to a page that does not exist

When sign-in is disabled, a non-administrator who signs in is signed out
again and redirected to /pages/maintenance.html, a page that has never
existed in this repository. The sign-in page posts the credentials with
XHR, follows the redirect, and cannot read the response, so the person
is told that the username or password is wrong. The refusal is now a
JSON body in the format WISEAuthenticationFailureHandler already uses,
with isLoginDisabled set, and the unused LOGIN_DISABLED_MESSGE_PAGE
constant is removed.

@hirokiterashima hirokiterashima left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for fixing this old issue.

@hirokiterashima
hirokiterashima merged commit e297868 into WISE-Community:develop Nov 25, 2026
1 check passed
@hirokiterashima

Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.28.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants