Фикс получения и обновления токенов
Some checks failed
Verify Dev Build / publish (push) Has been cancelled
Some checks failed
Verify Dev Build / publish (push) Has been cancelled
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "oxidespotify"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
description = "Client for Spotify API"
|
||||
readme = "README.md"
|
||||
authors = [{ name = "Miwory", email = "miwory.uwu@gmail.com" }]
|
||||
|
||||
@ -41,14 +41,14 @@ class SpotifyAuthClient(OxideHTTP):
|
||||
|
||||
data = await req.json()
|
||||
if req.status_code >= 400:
|
||||
raise s.ClientError(req.status_code, data['error']['message'])
|
||||
raise s.ClientError(req.status_code, data['error'])
|
||||
|
||||
return schema.model_validate(data)
|
||||
|
||||
async def user_access_token(self, code: str) -> s.UserAccessToken:
|
||||
req = await self.post(
|
||||
'/token',
|
||||
json={
|
||||
form={
|
||||
'grant_type': 'authorization_code',
|
||||
'code': code,
|
||||
'redirect_uri': self.__redirect_uri,
|
||||
@ -60,7 +60,7 @@ class SpotifyAuthClient(OxideHTTP):
|
||||
async def refresh_access_token(self, refresh_token: str) -> s.Token:
|
||||
req = await self.post(
|
||||
'/token',
|
||||
json={
|
||||
form={
|
||||
'grant_type': 'refresh_token',
|
||||
'refresh_token': refresh_token,
|
||||
'client_id': self.__client_id,
|
||||
|
||||
Reference in New Issue
Block a user