Skip to content

Conversation

@diogobaeder
Copy link
Contributor

This change makes sure the session token gets cleaned before fetching a new one.

The reason is: if I fetch a token from the OAuth2 server, and use the session for more time than the expiration time, and try to fetch a token again, the session will raise a TokenExpiredError. Normally one should use the refresh_token method for this purpose, but not all OAuth2 server implementations provide a refresh token endpoint (I'm working with one that doesn't), so it's important to allow the fetching of new tokens without checking the validity of previous ones.

@Lukasa
Copy link
Member

Lukasa commented Dec 18, 2015

This seems reasonable to me. =)

Lukasa added a commit that referenced this pull request Dec 18, 2015
Cleaning the previous token before fetching a new one, to avoid a Tok…
@Lukasa Lukasa merged commit a6c72ed into requests:master Dec 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants