Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Improvements for authentication flow #25

Closed
mikonse opened this issue Oct 21, 2019 · 3 comments
Closed

Improvements for authentication flow #25

mikonse opened this issue Oct 21, 2019 · 3 comments
Labels
enhancement New feature or request stale

Comments

@mikonse
Copy link
Contributor

mikonse commented Oct 21, 2019

I would like to propose some improvements to the API for initializing Spotify Users.
Currently, as of my pull request from a few days ago there are multiple ways to create an authenticated User object:
User.from_code, User.from_token, and User.from_refresh_token.

There is two improvements I'd like to make. First combine the from_token and from_refresh_token methods into one, e.g. from_token_info that takes a tuple of optional parameters, access_token, expiry_time, refresh_token and then correctly instantiates and authenticates the User depending on what tokens it got.

The second improvement is the option to add a cache path to store the access and refresh tokens and later on reinitialize the User by just providing the cache path. This would make it easier to have persistent applications where one does not want to go through the oauth flow every time and does not want to bother with storing the tokens themselves.

I have the changes ready and will make a pull request soon, just wanted to open this issue to allow for discussion about the changes.

@mental32
Copy link
Owner

@mikonse I'm working on a local v0.8.0 branch that I'll be pushing later, could you make your changes off the current master HEAD off a separate branch?

@mental32
Copy link
Owner

Apologies for the delay, I've just pushed and merged v0.8.0.

@mikonse
Copy link
Contributor Author

mikonse commented Oct 22, 2019

Alright, i'll get my changes integrated and then open a merge request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

2 participants