Repository navigation
Show an error note when login is rejected for an untrusted origin - #67393
Open
wanjinhao1 wants to merge 2 commits into
Open
wanjinhao1 wants to merge 2 commits into
wanjinhao1 wants to merge 2 commits into
Conversation
… untrusted origin Signed-off-by: wanjinhao1 <394959433@qq.com>
wanjinhao1
requested review from
kristian-zendato and
skjnldsv
and removed request for
a team
December 1, 2026 18:21
skjnldsv
reviewed
Dec 1, 2026
| v-if="invalidOrigin" | ||
| :heading="t('core', 'Untrusted origin')" | ||
| type="warning"> | ||
| {{ t('core', 'The login request did not come from a trusted origin. Please reload the page and try again, or contact your administrator.') }} |
Member
There was a problem hiding this comment.
Why would reloading the page make any difference ? 🤔
I like the idea though
…sted-origin note Signed-off-by: wanjinhao1 <394959433@qq.com>
Author
|
Good point — it usually wouldn't: the |
skjnldsv
approved these changes
Dec 2, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
LoginController::tryLogin()rejects login requests whoseOriginheader is not trusted with theinvalidOriginerror, but the login form did not handle that error, so the user landed back on the form with no message, as if the login had been silently ignored.This adds an
invalidOriginnote card (warning, likeapacheAuthFailed) with a heading and a message telling the user to reload the page and try again, or contact their administrator, and a test case in the existingLoginFormspec covering the new error rendering.TODO
Checklist
NcNoteCardin the same style as the existingcsrfCheckFailed/apacheAuthFailednotes, no layout change3. to review, feature component) — leaving to maintainersstable32) — leaving to maintainersAI (if applicable)
Assisted by an AI coding agent; the change was reviewed, tested locally (
npx vitest run core/src/tests/components/Login/LoginForm.spec.ts, 11 tests passing) and signed off by the contributor.