-
Notifications
You must be signed in to change notification settings - Fork 81
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
Fix web authentication scopes #90
Conversation
…ng the disconnect() method.
…e"; if the scope parameter is null.
Some small things could be improved. Edit: I just noticed that we have this linting rule that asks for local variables to be declared as |
Co-authored-by: Foti Dim <[email protected]>
Also please state this fix in the changelog under |
@itsMatoosh we need to release 2.1.0 soonish as iOS is broken in 2.0.0. If we could finish it up in time would be nice, otherwise it will have to wait for either 2.1.1 or 2.2. |
…rium/spotify_sdk into bugfix/web-authentication-scopes # Conflicts: # lib/spotify_sdk_web.dart
…eb-authentication-scopes
@fotiDim This should be now all resolved. Sorry for the delay, I was having important uni exams. |
lib/spotify_sdk_web.dart
Outdated
@@ -163,7 +158,8 @@ class SpotifySdkPlugin { | |||
} | |||
|
|||
// get initial token | |||
await _authorizeSpotify(clientId: clientId!, redirectUrl: redirectUrl!); | |||
await _authorizeSpotify( | |||
clientId: clientId!, redirectUrl: redirectUrl!, scopes: scopes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clientId: clientId!, redirectUrl: redirectUrl!, scopes: scopes); | |
clientId: clientId, redirectUrl: redirectUrl, scopes: scopes); |
lib/spotify_sdk_web.dart
Outdated
if (!(clientId?.isNotEmpty == true && | ||
redirectUrl?.isNotEmpty == true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better change that one as the one below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, that is indeed much better, I made the changes now.
Co-authored-by: Foti Dim <[email protected]>
Co-authored-by: Foti Dim <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes. Looks good! 😎
The web implementation will now use the authentication scopes supplied by the user in methods
SpotifySdk.connectToSpotifyRemote
andSpotifySdk.getAuthenticationToken
. Removed hardcoded scopes. If the supplied scope is null, the implementation will use the minimal list of scopes that are required for the web player to work.Fixes #87