Skip to content

Commit

Permalink
ensure client_id is provided for authorize endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Puyodead1 authored Dec 9, 2023
1 parent 6f031db commit e9b03ac
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/api/routes/oauth2/authorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ const router = Router();
router.get(
"/",
route({
query: {
client_id: {
type: "string",
},
},
responses: {
// TODO: I really didn't feel like typing all of it out
200: {},
Expand All @@ -49,6 +54,14 @@ router.get(
async (req: Request, res: Response) => {
// const { client_id, scope, response_type, redirect_url } = req.query;
const { client_id } = req.query;
if (!client_id) {
throw FieldErrors({

Check failure on line 58 in src/api/routes/oauth2/authorize.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Cannot find name 'FieldErrors'.
client_id: {
code: "BASE_TYPE_REQUIRED",
message: req.t("common:field.BASE_TYPE_REQUIRED"),
},
});
}

const app = await Application.findOne({
where: {
Expand Down

0 comments on commit e9b03ac

Please sign in to comment.