Skip to content

Commit

Permalink
Update onedrive.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TechiError committed Jan 1, 2024
1 parent dfe5f64 commit cfb844f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bot/onedrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ async def get_access_token(self, code: str = None):
headers={"Content-Type": "application/x-www-form-urlencoded"},
data=data,
) as resp:
expiry_time = self.creds.get("expires_in")
self.creds = await resp.json()
self.creds["expires_at"] = time.time() + expiry_time
if self.creds.get("error"):
return self.creds
self.creds["expires_at"] = time.time() + self.creds.get("expires_in")
udB.set_key("OD_AUTH_TOKEN", self.creds)
await resp.release()
return self.creds
Expand Down

0 comments on commit cfb844f

Please sign in to comment.