Skip to content

Commit

Permalink
Configurable host and port in UserAuthenticator to catch redirect
Browse files Browse the repository at this point in the history
Using the UserAuthenticator could not catch the redirect call with a non default port. This fixes it.
  • Loading branch information
nojoule authored Aug 21, 2024
1 parent 2edb8d9 commit 9c9cc07
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit 9c9cc07

Please sign in to comment.