Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit b4c3f7c

Browse files
Remove 'code' param
It gets set by Facebook. If it stays in the redirect URL, strict mode won't work.
1 parent 2762670 commit b4c3f7c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Facebook/Helpers/FacebookRedirectLoginHelper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,9 @@ public function getAccessToken($redirectUrl = null)
222222
$this->resetCsrf();
223223

224224
$redirectUrl = $redirectUrl ?: $this->urlDetectionHandler->getCurrentUrl();
225-
// At minimum we need to remove the state param
226-
$redirectUrl = FacebookUrlManipulator::removeParamsFromUrl($redirectUrl, ['state']);
225+
226+
// At minimum we need to remove the 'state' and 'code' params
227+
$redirectUrl = FacebookUrlManipulator::removeParamsFromUrl($redirectUrl, ['code', 'state']);
227228

228229
return $this->oAuth2Client->getAccessTokenFromCode($code, $redirectUrl);
229230
}

0 commit comments

Comments
 (0)