Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Thellimist/pi 721 #103

Merged
merged 16 commits into from
Aug 25, 2016
Merged

Thellimist/pi 721 #103

merged 16 commits into from
Aug 25, 2016

Conversation

thellimist
Copy link
Contributor

No description provided.

} else {
$apiResponse = $apiRouter->getAPIClient()->createAPIError("CSRF Token not valid.");
}
$response = $requestRouter->route($request);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't remove the CSRF check logic - need:

if($isCSRFTokenValid) {
$apiResponse = $apiRouter->route($request);
}

if ($isCSRFTokenValid) {
$response = $requestRouter->route($request);
} else {
$response = $apiRouter->getAPIClient()->createAPIError('CSRF Token not valid.');
Copy link
Contributor

Choose a reason for hiding this comment

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

$apiRouter doesn't exist anymore. Just have the response be the string "CSRF Token not valid, please refresh the page.". 90% of the times this happens it will be malicious so its okay if its not pretty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. A single string response would not be shown in the error notifications. Response should be a full response object

@jwineman jwineman merged commit 7974472 into master Aug 25, 2016
@jwineman jwineman deleted the thellimist/PI-721 branch August 25, 2016 18:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants