Skip to content

Commit e4cd96c

Browse files
committed
fix: return the proper response when the OAuth2 refresh token is invalid
1 parent 8aeedc6 commit e4cd96c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/ts/recipe/oauth2provider/recipeImplementation.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,16 @@ export default function getRecipeInterface(
471471
return tokenInfo;
472472
}
473473

474+
if (!tokenInfo.active) {
475+
return {
476+
status: "ERROR",
477+
statusCode: 400,
478+
error: "invalid_grant",
479+
errorDescription:
480+
"The provided refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.",
481+
};
482+
}
483+
474484
if (tokenInfo.active === true) {
475485
const sessionHandle = tokenInfo.sessionHandle as string;
476486

0 commit comments

Comments
 (0)