Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store OAuth global variables on initial auth #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions trakt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def oauth_auth(username, client_id=None, client_secret=None, store=False,
PIN. Default function `_terminal_oauth_pin` for terminal auth
:return: Your OAuth access token
"""
global CLIENT_ID, CLIENT_SECRET, OAUTH_TOKEN
global CLIENT_ID, CLIENT_SECRET, OAUTH_TOKEN, OAUTH_REFRESH, OAUTH_EXPIRES_AT
if client_id is None and client_secret is None:
client_id, client_secret = _get_client_info()
CLIENT_ID, CLIENT_SECRET = client_id, client_secret
Expand Down Expand Up @@ -259,7 +259,7 @@ def get_device_token(device_code, client_id=None, client_secret=None,
:return: Information regarding the authentication polling.
:return type: dict
"""
global CLIENT_ID, CLIENT_SECRET, OAUTH_TOKEN, OAUTH_REFRESH
global CLIENT_ID, CLIENT_SECRET, OAUTH_TOKEN, OAUTH_REFRESH, OAUTH_EXPIRES_AT
if client_id is None and client_secret is None:
client_id, client_secret = _get_client_info()
CLIENT_ID, CLIENT_SECRET = client_id, client_secret
Expand Down