Skip to content

Commit 59364b6

Browse files
Faisd405atymic
andauthored
Fix Instagram OAuth URL formatting and scope separator (#1435)
Co-authored-by: atymic <atymicq@gmail.com>
1 parent 66ecea2 commit 59364b6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Instagram/Provider.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Provider extends AbstractProvider
1010
{
1111
public const IDENTIFIER = 'INSTAGRAM';
1212

13-
protected $scopeSeparator = ' ';
13+
protected $scopeSeparator = ',';
1414

1515
/**
1616
* The user fields being requested.
@@ -21,6 +21,18 @@ class Provider extends AbstractProvider
2121

2222
protected $scopes = ['instagram_business_basic'];
2323

24+
protected function buildAuthUrlFromBase($url, $state)
25+
{
26+
$query = http_build_query(
27+
$this->getCodeFields($state),
28+
'',
29+
'&',
30+
$this->encodingType
31+
);
32+
33+
return $url . '?' . urldecode($query);
34+
}
35+
2436
protected function getAuthUrl($state): string
2537
{
2638
return $this->buildAuthUrlFromBase('https://api.instagram.com/oauth/authorize', $state);

0 commit comments

Comments
 (0)