Skip to content

Commit 763c5c3

Browse files
authored
Fix Discord URL
1 parent a0cbeb0 commit 763c5c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/OAuth2.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function __construct($clientId, $secret, $redirectUrl) {
1212
public function startRedirection($scope) {
1313
$randomString = OAuth2::generateToken();
1414
$_SESSION['oauth2state'] = $randomString;
15-
header('Location: https://discordapp.com/api/oauth2/authorize?client_id=' . $this->_clientId . '&redirect_uri=' . urlencode($this->_redirectUrl) . '&response_type=code&scope=' . join('%20', $scope) . "&state=" . $randomString);
15+
header('Location: https://discord.com/api/oauth2/authorize?client_id=' . $this->_clientId . '&redirect_uri=' . urlencode($this->_redirectUrl) . '&response_type=code&scope=' . join('%20', $scope) . "&state=" . $randomString);
1616
}
1717

1818
public function isRedirected() {
@@ -42,7 +42,7 @@ private function getInformation($endpoint) {
4242
return ["code" => 0, "message" => $response];
4343
}
4444
}
45-
$curl = curl_init('https://discordapp.com/api/v6/' . $endpoint);
45+
$curl = curl_init('https://discord.com/api/v6/' . $endpoint);
4646
curl_setopt($curl, CURLOPT_RETURNTRANSFER, "false");
4747
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
4848
'Authorization: Bearer ' . $this->_accessToken
@@ -59,7 +59,7 @@ public function loadToken() {
5959
}
6060
$curl = curl_init();
6161
curl_setopt_array($curl, array(
62-
CURLOPT_URL => "https://discordapp.com/api/v6/oauth2/token",
62+
CURLOPT_URL => "https://discord.com/api/v6/oauth2/token",
6363
CURLOPT_CUSTOMREQUEST => "POST",
6464
CURLOPT_POSTFIELDS => "client_id=" . $this->_clientId . "&client_secret=" . $this->_secret . "&grant_type=authorization_code&code=" . $_GET['code'] . "&redirect_uri=" . urlencode($this->_redirectUrl),
6565
CURLOPT_RETURNTRANSFER => "false"

0 commit comments

Comments
 (0)