Skip to content

Commit

Permalink
fix: update error messages in grant routes
Browse files Browse the repository at this point in the history
  • Loading branch information
njlie committed Feb 21, 2024
1 parent 25c870a commit dfbb8d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions packages/auth/src/grant/routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ describe('Grant Routes', (): void => {
).rejects.toMatchObject({
status: 400,
error: {
code: 'interaction_required',
description: 'missing required request field'
code: 'invalid_request',
description:
"missing required request field 'interact'"
}
})
} else {
Expand Down Expand Up @@ -338,8 +339,8 @@ describe('Grant Routes', (): void => {
await expect(grantRoutes.create(ctx)).rejects.toMatchObject({
status: 400,
error: {
code: 'interaction_required',
description: 'missing required request field'
code: 'invalid_request',
description: "missing required request field 'interact'"
}
})
})
Expand Down Expand Up @@ -441,7 +442,7 @@ describe('Grant Routes', (): void => {
status: 400,
error: {
code: 'invalid_client',
description: 'missing required request field'
description: "missing required request field 'client'"
}
})
})
Expand Down
8 changes: 4 additions & 4 deletions packages/auth/src/grant/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ async function createPendingGrant(
const { body } = ctx.request
const { grantService, interactionService, config } = deps
if (!body.interact) {
ctx.throw(400, 'interaction_required', {
ctx.throw(400, 'invalid_request', {
error: {
code: 'interaction_required',
description: 'missing required request field'
code: 'invalid_request',
description: "missing required request field 'interact'"
}
})
}
Expand All @@ -167,7 +167,7 @@ async function createPendingGrant(
ctx.throw(400, 'invalid_client', {
error: {
code: 'invalid_client',
description: 'missing required request field'
description: "missing required request field 'client'"
}
})
}
Expand Down

0 comments on commit dfbb8d0

Please sign in to comment.