-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Doorkeeper::AccessToken.find_or_create_for
with empty scopes raises NoMethodError
#1699
Comments
Hi, thanks for this awesome and useful gem! I can look into the issue and propose some tests + fix. But before getting to work, I want to make sure this is a valid case and I am not missing anything. Thank you! |
Hey @pdany1116 . Try to use Also even plain one works without issues for me: Looks like depends from configuration, but try to use above advise. UPD: yes, requires |
Indeed, I have the Works with |
Can we close this issue? Or do you think it makes sense to add some extra protection into def find_or_create_for(application:, resource_owner:, scopes:, **token_attributes)
scopes = Doorkeeper::OAuth::Scopes.from_string(scopes) if scopes.is_a?(String)
# ...
end |
I think it makes sense to add extra protection, I was not expecting this to be the problem, maybe other devs will encounter the same issue and be confused. I would like to contribute if possible 😄 |
Yeah sure, will be great @pdany1116 , thanks a lot! Please refer CONTRIBUTING guide when open a PR 🙏 |
Steps to reproduce
Doorkeeper::AccessToken.find_or_create_for
raises NoMethodError when searching with empty scopes.Expected behavior
A new Doorkeeper::AccessToken should be created with empty scopes.
Actual behavior
System configuration
Ruby version 3.0.6
Doorkeeper version 5.6.6
The text was updated successfully, but these errors were encountered: