-
Notifications
You must be signed in to change notification settings - Fork 97
Conversation
} else { | ||
$apiResponse = $apiRouter->getAPIClient()->createAPIError("CSRF Token not valid."); | ||
} | ||
$response = $requestRouter->route($request); |
There was a problem hiding this comment.
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.'); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
No description provided.