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

Configurable host and port in UserAuthenticator to catch redirect #331

Open
wants to merge 1 commit into
base: master
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
10 changes: 6 additions & 4 deletions twitchAPI/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,17 @@ def __init__(self,
scopes: List[AuthScope],
force_verify: bool = False,
url: str = 'http://localhost:17563',
host: str = '0.0.0.0',
port: int = 17563,
auth_base_url: str = TWITCH_AUTH_BASE_URL):
"""

:param twitch: A twitch instance
:param scopes: List of the desired Auth scopes
:param force_verify: If this is true, the user will always be prompted for authorization by twitch |default| :code:`False`
:param url: The reachable URL that will be opened in the browser. |default| :code:`http://localhost:17563`
:param host: The host the webserver will bind to. |default| :code:`0.0.0.0`
:param port: The port that will be used for the webserver. |default| :code:`17653`
:param auth_base_url: The URL to the Twitch API auth server |default| :const:`~twitchAPI.helper.TWITCH_AUTH_BASE_URL`
"""
self._twitch: 'Twitch' = twitch
Expand All @@ -285,10 +289,8 @@ def __init__(self,
</body>
</html>"""
"""The document that will be rendered at the end of the flow"""
self.port: int = 17563
"""The port that will be used. |default| :code:`17653`"""
self.host: str = '0.0.0.0'
"""the host the webserver will bind to. |default| :code:`0.0.0.0`"""
self.port: int = port
self.host: str = host
self.state: str = str(get_uuid())
self._callback_func = None
self._server_running: bool = False
Expand Down