fix: add CSRF token output to install wizard#763
Open
anonymoususer72041 wants to merge 1 commit intoopencats:masterfrom
Open
fix: add CSRF token output to install wizard#763anonymoususer72041 wants to merge 1 commit intoopencats:masterfrom
anonymoususer72041 wants to merge 1 commit intoopencats:masterfrom
Conversation
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.
When the install wizard is opened while an authenticated OpenCATS session is still active, its initial AJAX request can fail with "-1 Invalid request." because ajax.php enforces CSRF validation for logged-in sessions, but installwizard.php did not expose CATSCsrfToken for js/lib.js to append to the request.
This change starts the existing OpenCATS session before any HTML output in installwizard.php, loads the required session and template classes and outputs CATSCsrfToken when an authenticated session is present.
The CSRF validation in ajax.php remains unchanged. Logged-out install wizard access continues to behave as before, while logged-in sessions now provide the token needed for installer AJAX requests.