Release v1.12.0 Explicit Scope
v1.12.0 reverts the default scopes that were introduced in v1.11.x
Now there is only one standard scope...
- basic: "" (empty string)
In this release modules must explicitly define empty strings for common scopes. Not sure what that means? Let me explain.
So if you we have a generic function like which calls hello.login with the scope 'email' (a standard scope in hellojs v1.11), like so...
login(network) => hello(network).login({scope.email});
Now lets say that all but one of the providers linked to this service supported the email scope. The one that didn't is the one we are worrying about.
- In v1.11.x: The module for network which doesn't support the scope 'email' would not have to worry, because it was a standard scope which defaulted to an empty string and it would not be applied to the OAuth login request. Conversely if the others supported the email string they would have to explicitly define it.
email: 'email'. - In this version v1.12.0: Its changed instead the module must explicitly say that it doesn't support that scope. i.e.
scope: {
email: ''
}
Typically its left up to the person implementing the library to know which scopes the provider supports But in the case of the the bundled modules its nice to map the scopes to an empty string to help the developer out. Doing it this way does involves more configuration (arguably), setting common scopes to an empty string, but on the flip side if they support the common scope then they dont have to set laboriously map the value to itself, with email: 'email'.
The real benefit comes with creating new modules. Developers dont need to know about this secret standards list which HelloJS has applied. So they can use any scope without having to wonder why its not been applied.
I hope that makes sense.
Thanks