Skip to content

Commit

Permalink
fix: (#503) remove refresh token logic (#507)
Browse files Browse the repository at this point in the history
Remove the existing refresh token upon an unauthorized response from the fetch token endpoint
  • Loading branch information
blakewilson committed Sep 27, 2021
1 parent 5f2349d commit aaad74c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/auth/server/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export async function authorizeHandler(
res.statusCode = result.response.status;
} else {
res.statusCode = 401;

// If the response to the token endpoint is unauthorized, remove the existing refresh token.
oauth.setRefreshToken(undefined);
}

res.end(JSON.stringify(result.result));
Expand Down

0 comments on commit aaad74c

Please sign in to comment.