Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit 283fc99

Browse files
committed
Fix #19 using non-default redirect_uri
1 parent 4609413 commit 283fc99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/onedrivesdk/helpers/GetAuthCodeServer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def get_auth_code(auth_url, redirect_uri):
4848
Returns:
4949
str: A string representing the auth code, sent back by the server
5050
"""
51-
HOST, PORT = "localhost", 8080
51+
HOST, PORT = urlparse(redirect_uri).netloc.split(':')
52+
PORT = int(PORT)
5253
# Set up HTTP server and thread
5354
code_acquired = threading.Event()
5455
s = GetAuthCodeServer((HOST, PORT), code_acquired, GetAuthCodeRequestHandler)

0 commit comments

Comments
 (0)