Skip to content

Commit

Permalink
feat: add error and error_description to to adapter error responses
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonraimondi committed Aug 7, 2024
1 parent 16c658f commit 9714d70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/adapters/express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export function handleExpressError(e: unknown | OAuthException, res: Response):
res.send({
status: e.status,
message: e.message,
error: e.errorType,
error_description: e.errorDescription ?? e.error,
});
return;
}
Expand Down
2 changes: 2 additions & 0 deletions src/adapters/fastify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export function handleFastifyError(e: unknown | OAuthException, res: FastifyRepl
res.status(e.status).send({
status: e.status,
message: e.message,
error: e.errorType,
error_description: e.errorDescription ?? e.error,
});
return;
}
Expand Down

0 comments on commit 9714d70

Please sign in to comment.