Yashasv-Prajapati / Docify

5 stars 2 forks source link

changes done to /app/api/github/callback/route.ts file to handle expiration #83

Closed Yashasv-Prajapati closed 3 months ago

Yashasv-Prajapati commented 3 months ago

Changes done to /app/api/github/callback/route.ts file to handle expiration of access token using refresh token.

  1. First it checks if the user access token is valid or not by sending a request to fetch the repositories.
  2. If the access token is not valid, then it uses the refresh token stored in db to fetch a new access token and then again make a request for fetching repositories.
  3. No more requests are made and gives error and nothing is displayed on the client-side
linear[bot] commented 3 months ago
CS3-95 Github handle access_token expiration

In case the access_token expires(which it does in every 8hours), use the refresh_token stored in db to perform operations on db.