-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
authenticate
endpoint still expects scope
as a string
instead of string[]
#281
Comments
@Valerionn thank you for reporting. From what I see this must be still wrong in the types and docs, since scope must be a string, according to the standard. // CC @dhensby |
Ah, a good spot. As I remember, our intention was that this should be an array of strings (my understanding was we wanted the developer's interface to deal with arrays of strings for scopes, but the HTTP interactions are a single string with space delimited scopes (as per the spec)). Implementing that intention as a "bug fix" will be quite disruptive, though... I see three choices:
|
This is the related PR: #267
@Valerionn so the parseScope expects a string and will at the end split it into an array. Model-implementations will receive and return arrays while From what I see this rather calls for a fix in the docs. |
@jankapunkt A fix in the docs and Typescript types sounds good to me as well (then I won't have to manually cast the type there). I just found it weird that the library expects a Btw. (regarding types), the If you want to, I can make a PR with the doc + typing changes so they match the code (I just didn't want to make a PR yet because I didn't know the intended behavior). |
Specify your setup
Irrelevant
Describe the bug
According to the Documentation and the Typescript typings,
OAuth2Server.authenticate
expectsoptions.scope
, which is of typestring[]
. However, in authenticate-handler.js, this scope is passedd toparseScope
[source], which expectsscope
to be a string:To Reproduce
Try to pass a
scope
-Array toauthenticate
Expected behavior
No error thrown, but instead an error would be thrown if I wouldn't pass an array.
The text was updated successfully, but these errors were encountered: