Skip to content

Commit c93e73e

Browse files
authored
docs: add missing code-block (#2982)
Add missing code-block
1 parent 6a59cf8 commit c93e73e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/examples/Authentication.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ A Github App can authenticate on behalf of a user. For this, the user has to `ge
116116
This process completes with a one-time ``code``. Together with the ``client_id`` and ``client_secret`` of the app,
117117
a Github App user token can be generated once:
118118

119+
.. code-block:: python
120+
119121
>>> g = Github()
120122
>>> app = g.get_oauth_application(client_id, client_secret)
121123
>>> token = app.get_access_token(code)
@@ -126,12 +128,16 @@ The ``token.token`` expires 8 hours, and the ``token.refresh_token`` expires 6 m
126128
A token can be refreshed as follows. This invalidates the old token and old refresh token, and creates
127129
a new set of token and refresh tokens:
128130

131+
.. code-block:: python
132+
129133
>>> g = Github()
130134
>>> app = g.get_oauth_application(client_id, client_secret)
131135
>>> token = app.refresh_access_token(refresh_token)
132136
133137
You can authenticate with Github using this token:
134138

139+
.. code-block:: python
140+
135141
>>> auth = app.get_app_user_auth(token)
136142
>>> g = Github(auth=auth)
137143
>>> g.get_user().login

0 commit comments

Comments
 (0)