Open maxsupermanhd opened 1 year ago
How is this related to the oauth2 package? Seems you'll need to open issue upstream.
Seems you'll need to open issue upstream.
I already talked to ravener about the issue and he does not know the cause of it. Problem is that Other social networks like VK does not refresh their token either. It seems to me that oauth2 library does not refresh token for me even though it is clearly said in the docs that it should and will do it when needed.
Sounds like an application, not a library issue. I'd suggest to debug the application code. This is not an oauth2 package topic.
Trying to add a discord oauth2 (using github.com/ravener/discord-oauth2) but whenever token expires it fails(?) to refresh it and returns
Get "https://discord.com/api/users/@me": oauth2: cannot fetch token: 400 Bad Request-Response: {"error": "invalid_grant"}
I manually check for modification of
AccessToken
,RefreshToken
andExpiry
and store it in the database. Whenever it is time for token to be refreshed it just fails with error above.Code: https://github.com/Warzone2100/wz2100-autohost.net/blob/master/discordauth.go#L51 Token struct storage: https://github.com/Warzone2100/wz2100-autohost.net/blob/master/main.go#L134C8-L134C8