Closed StrangerGithuber closed 6 years ago
--> please try to look in the already closed issues if your problem was already adressed at some point.
I don't understand what variable I need to save but ok. 👍
Thanks for the help while I was busy with other things, @HayateLaTech !
@StrangerGithuber You need to save refreshToken and use it in refresh_token grant:
$_SESSION["token"] = $token->getRefreshToken(); $token = $provider->getAccessToken('refresh_token', [ 'refresh_token' => $_SESSION["token"] ]);
Hello When I am updating the page then I get this error message:
Fatal error: Uncaught exception 'Wohali\OAuth2\Client\Provider\Exception\DiscordIdentityProviderException' with message '{"error":"invalid_grant"}' in C:\xampp56\htdocs\discordapp\vendor\wohali\oauth2-discord-new\src\Provider\Exception\DiscordIdentityProviderException.php:47 Stack trace: #0 C:\xampp56\htdocs\discordapp\vendor\wohali\oauth2-discord-new\src\Provider\Exception\DiscordIdentityProviderException.php(34): Wohali\OAuth2\Client\Provider\Exception\DiscordIdentityProviderException::fromResponse(Object(GuzzleHttp\Psr7\Response), '{"error":"inval...') #1 C:\xampp56\htdocs\discordapp\vendor\wohali\oauth2-discord-new\src\Provider\Discord.php(110): Wohali\OAuth2\Client\Provider\Exception\DiscordIdentityProviderException::clientException(Object(GuzzleHttp\Psr7\Response), Array) #2 C:\xampp56\htdocs\discordapp\vendor\league\oauth2-client\src\Provider\AbstractProvider.php(613): Wohali\OAuth2\Client\Provider\Discord->checkResponse(Object(GuzzleHttp\Psr7\Response), Array) #3 C:\xampp56\htdocs\discordapp\vendor\league\oauth2-c in C:\xampp56\htdocs\discordapp\vendor\wohali\oauth2-discord-new\src\Provider\Exception\DiscordIdentityProviderException.php on line 47
In the url there is the state and the code thought. I don't understand why I get this then. I am redirected to discord and I click to Authorize and it works but if I refresh the page then I get the above message. I did as in example was.
If I click somewhere else then I will be redirected again to the discord page.