Skip to content

Improve error message when auth scope is insufficient #2028

@dschenkelman

Description

@dschenkelman

Right now the code uses

return next(Boom.forbidden('Insufficient scope - ' + config.scope + ' expected'));

With scope configured like this:

scope: ['delete:users', 'delete:current_user']

It results in the following error message: 'Insufficient scope - delete:users,delete:current_user expected'.

Since it is just joining the array elements with commas it is not clear if the expected scopes are any of those or all of those. I think a possible improvement could be: 'Insufficient scope, expected any of: delete:users, delete:current_user'.

Thoughts?

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions