We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b44e2f4 + 499d0e4 commit 535eb8aCopy full SHA for 535eb8a
src/Facebook/Helpers/FacebookRedirectLoginHelper.php
@@ -219,6 +219,7 @@ public function getAccessToken($redirectUrl = null)
219
}
220
221
$this->validateCsrf();
222
+ $this->resetCsrf();
223
224
$redirectUrl = $redirectUrl ?: $this->urlDetectionHandler->getCurrentUrl();
225
// At minimum we need to remove the state param
@@ -250,6 +251,14 @@ protected function validateCsrf()
250
251
throw new FacebookSDKException('Cross-site request forgery validation failed. The "state" param from the URL and session do not match.');
252
253
254
+ /**
255
+ * Resets the CSRF so that it doesn't get reused.
256
+ */
257
+ private function resetCsrf()
258
+ {
259
+ $this->persistentDataHandler->set('state', null);
260
+ }
261
+
262
/**
263
* Return the code.
264
*
0 commit comments