Skip to content

Commit 9bfe173

Browse files
authored
Merge branch 'master' into pkce
2 parents 9e6f581 + 424adf0 commit 9bfe173

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

HISTORY.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ v1.4.0 (TBD)
1414
- Migrated to Github Action
1515
- Add PKCE support
1616

17-
1817
v1.3.1 (21 January 2022)
1918
++++++++++++++++++++++++
2019

docs/oauth2_workflow.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,13 @@ is necessary but refreshing is done manually.
249249
>>> from requests_oauthlib import OAuth2Session
250250
>>> from oauthlib.oauth2 import TokenExpiredError
251251
>>> try:
252-
... client = OAuth2Session(client_id, token=token)
253-
... r = client.get(protected_url)
252+
... oauth = OAuth2Session(client_id, token=token)
253+
... r = oauth.get(protected_url)
254254
>>> except TokenExpiredError as e:
255-
... token = client.refresh_token(refresh_url, **extra)
255+
... token = oauth.refresh_token(refresh_url, **extra)
256256
... token_saver(token)
257-
>>> client = OAuth2Session(client_id, token=token)
258-
>>> r = client.get(protected_url)
257+
>>> oauth = OAuth2Session(client_id, token=token)
258+
>>> r = oauth.get(protected_url)
259259
260260
(Second) Define automatic token refresh automatic but update manually
261261
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -268,9 +268,9 @@ is done manually.
268268
269269
>>> from requests_oauthlib import OAuth2Session, TokenUpdated
270270
>>> try:
271-
... client = OAuth2Session(client_id, token=token,
271+
... oauth = OAuth2Session(client_id, token=token,
272272
... auto_refresh_kwargs=extra, auto_refresh_url=refresh_url)
273-
... r = client.get(protected_url)
273+
... r = oauth.get(protected_url)
274274
>>> except TokenUpdated as e:
275275
... token_saver(e.token)
276276
@@ -284,9 +284,9 @@ however that you still need to update ``expires_in`` to trigger the refresh.
284284
.. code-block:: pycon
285285
286286
>>> from requests_oauthlib import OAuth2Session
287-
>>> client = OAuth2Session(client_id, token=token, auto_refresh_url=refresh_url,
287+
>>> oauth = OAuth2Session(client_id, token=token, auto_refresh_url=refresh_url,
288288
... auto_refresh_kwargs=extra, token_updater=token_saver)
289-
>>> r = client.get(protected_url)
289+
>>> r = oauth.get(protected_url)
290290
291291
TLS Client Authentication
292292
-------------------------

0 commit comments

Comments
 (0)