Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message when auth scope is insufficient #2028

Closed
dschenkelman opened this issue Oct 17, 2014 · 4 comments
Closed

Improve error message when auth scope is insufficient #2028

dschenkelman opened this issue Oct 17, 2014 · 4 comments
Assignees
Labels
Milestone

Comments

@dschenkelman
Copy link
Contributor

@dschenkelman dschenkelman commented Oct 17, 2014

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?

@hueniverse
Copy link
Contributor

@hueniverse hueniverse commented Oct 17, 2014

Sure.

@dschenkelman
Copy link
Contributor Author

@dschenkelman dschenkelman commented Oct 17, 2014

Great! @hueniverse should I create a PR or do you handle these internally?

@dschenkelman
Copy link
Contributor Author

@dschenkelman dschenkelman commented Oct 17, 2014

Seemed like a small change so I went for it without waiting for an answer to the last question :)

hueniverse pushed a commit that referenced this issue Oct 17, 2014
Fixes #2028. Updated error message for invalid scope to explain that any of the specified are sufficient
@hueniverse hueniverse added this to the 7.0.1 milestone Oct 17, 2014
@hueniverse hueniverse self-assigned this Oct 17, 2014
@Marsup Marsup added feature and removed request labels Sep 20, 2019
@lock
Copy link

@lock lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants