Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Classes/Middleware/GetAuthenticationCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
*/
protected function isInstagramAuthentificationRedirect(ServerRequestInterface $request): bool
{
if (!empty($request->getQueryParams()['code'])) {
$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.

if (!empty($request->getQueryParams()['code'])) {
$code = $request->getQueryParams()['code'];
if (strlen($code) > 8) {
return true;
}
}
}
return false;
Expand Down