Skip to content

Conversation

EcoGabe
Copy link

@EcoGabe EcoGabe commented Mar 1, 2022

With the current way the request is being checked, this middleware will clash with any service using a parameter named "code" as a part of their OAuth flow. Checking if the referer is https://l.instagram.com/ will avoid this problem.

$code = $request->getQueryParams()['code'];
if (strlen($code) > 8) {
return true;
if (in_array('https://l.instagram.com/', $request->getHeader('referer'))) {

Choose a reason for hiding this comment

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

In my case the referer header contains the App return URL and not l.instagram.com - not sure if instagram changed anything in the way they redirect. With this check, no authentication code can be obtained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants