Reset the provided token. Args: access_token (str): The Github OAuth token. Returns: str: The new Github OAuth token.
(oauth_token)
| 195 | |
| 196 | |
| 197 | def reset_token(oauth_token): |
| 198 | """Reset the provided token. |
| 199 | |
| 200 | Args: |
| 201 | access_token (str): The Github OAuth token. |
| 202 | |
| 203 | Returns: |
| 204 | str: The new Github OAuth token. |
| 205 | |
| 206 | """ |
| 207 | _params = build_auth_dict(oauth_token) |
| 208 | _auth = (_params['client_id'], _params['client_secret']) |
| 209 | url = TOKEN_URL.format(**_params) |
| 210 | response = requests.post(url, auth=_auth, headers=HEADERS) |
| 211 | if response.status_code == 200: |
| 212 | return response.json().get('token') |
| 213 | return '' |
| 214 | |
| 215 | |
| 216 | def get_auth_url(redirect_uri='/'): |