Stateful redirect for implicitgrantstrategy #110
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Changes
#109
It's recommended in the docs and afaik as good practice to preserve some sort of
stateduring an auth flow like this. Currently with this library there's no way to send in state during the authorization that I can get back on redirect and verify.Results
My changes only include an update to enable stateful redirect on the ImplicitGrantStrategy and I believe I've done it in a non-breaking way with an optional string argument
When a client using the ImplicitGrantStrategy calls
authorizeon the main SpotifyApi object, they can now provide astatestring as an argument that they can expect to see on the redirectUri after a successful authenticationI've opened this as a draft PR only for the ImplicitGrantStrategy for the time being to see if this is something that's even wanted by others using this library. If the maintainers like the feature then I'd be happy to expand on this PR or provide follow up PRs to implement stateful redirect for other applicable flows.