Skip to content

Commit 2df4d2a

Browse files
authored
Update OAuth2 base authorization URL (#44)
* Update OAuth2 base authorization URL * Fix authorization and access token tests This has been caused by #39 which did not appropriately update the authorization and access token URL tests in the same way as #33
1 parent f87a293 commit 2df4d2a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/Provider/Discord.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ class Discord extends AbstractProvider
2626
use BearerAuthorizationTrait;
2727

2828
/**
29-
* API Domain
29+
* Default host
30+
*
31+
* @var string
32+
*/
33+
public $host = 'https://discord.com';
34+
35+
/**
36+
* API domain
3037
*
3138
* @var string
3239
*/
@@ -39,7 +46,7 @@ class Discord extends AbstractProvider
3946
*/
4047
public function getBaseAuthorizationUrl()
4148
{
42-
return $this->apiDomain.'/oauth2/authorize';
49+
return $this->host.'/oauth2/authorize';
4350
}
4451

4552
/**

test/src/Provider/DiscordTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function testGetAuthorizationUrl()
5454
$url = $this->provider->getAuthorizationUrl();
5555
$uri = parse_url($url);
5656

57-
$this->assertEquals('/api/oauth2/authorize', $uri['path']);
57+
$this->assertEquals('/oauth2/authorize', $uri['path']);
5858
}
5959

6060
public function testGetBaseAccessTokenUrl()
@@ -64,7 +64,7 @@ public function testGetBaseAccessTokenUrl()
6464
$url = $this->provider->getBaseAccessTokenUrl($params);
6565
$uri = parse_url($url);
6666

67-
$this->assertEquals('/api/oauth2/token', $uri['path']);
67+
$this->assertEquals('/api/v9/oauth2/token', $uri['path']);
6868
}
6969

7070
public function testGetAccessToken()

0 commit comments

Comments
 (0)