Spaces:
Sleeping
Sleeping
sathyaphaneeshwar
commited on
Commit
•
2fb9495
1
Parent(s):
84ec0a2
Login Fix
Browse files
app.py
CHANGED
@@ -36,7 +36,8 @@ app = Flask(__name__)
|
|
36 |
def oauth2callback():
|
37 |
global user_creds, user_info, auth_completed
|
38 |
flow = Flow.from_client_secrets_file(
|
39 |
-
CLIENT_SECRETS_FILE, SCOPES, redirect_uri='http://localhost:8080/oauth2callback')
|
|
|
40 |
flow.fetch_token(code=request.args.get('code'))
|
41 |
user_creds = flow.credentials
|
42 |
|
@@ -57,13 +58,14 @@ def oauth2callback():
|
|
57 |
return "Authentication successful! You can close this window and return to the app."
|
58 |
|
59 |
def start_server():
|
60 |
-
app.run(port=8080)
|
61 |
|
62 |
def login():
|
63 |
global user_creds, user_info, auth_completed
|
64 |
auth_completed = False
|
65 |
flow = Flow.from_client_secrets_file(
|
66 |
-
CLIENT_SECRETS_FILE, SCOPES, redirect_uri='http://localhost:8080/oauth2callback')
|
|
|
67 |
auth_url, _ = flow.authorization_url(prompt='consent')
|
68 |
|
69 |
# Start the local server in a separate thread
|
@@ -211,4 +213,5 @@ with gr.Blocks() as demo:
|
|
211 |
print_transcript_button.click(print_transcript, outputs=download_file)
|
212 |
|
213 |
if __name__ == '__main__':
|
|
|
214 |
demo.launch()
|
|
|
36 |
def oauth2callback():
|
37 |
global user_creds, user_info, auth_completed
|
38 |
flow = Flow.from_client_secrets_file(
|
39 |
+
#CLIENT_SECRETS_FILE, SCOPES, redirect_uri='http://localhost:8080/oauth2callback')https://sathyaphaneeshwar-transcript_gradio.hf.space/oauth2callback
|
40 |
+
CLIENT_SECRETS_FILE, SCOPES, redirect_uri='https://sathyaphaneeshwar-transcript_gradio.hf.space/oauth2callback')
|
41 |
flow.fetch_token(code=request.args.get('code'))
|
42 |
user_creds = flow.credentials
|
43 |
|
|
|
58 |
return "Authentication successful! You can close this window and return to the app."
|
59 |
|
60 |
def start_server():
|
61 |
+
app.run(host='0.0.0.0', port=8080)
|
62 |
|
63 |
def login():
|
64 |
global user_creds, user_info, auth_completed
|
65 |
auth_completed = False
|
66 |
flow = Flow.from_client_secrets_file(
|
67 |
+
#CLIENT_SECRETS_FILE, SCOPES, redirect_uri='http://localhost:8080/oauth2callback')https://sathyaphaneeshwar-transcript-gradio.hf.space/oauth2callback
|
68 |
+
CLIENT_SECRETS_FILE, SCOPES, redirect_uri='https://sathyaphaneeshwar-transcript-gradio.hf.space/oauth2callback')
|
69 |
auth_url, _ = flow.authorization_url(prompt='consent')
|
70 |
|
71 |
# Start the local server in a separate thread
|
|
|
213 |
print_transcript_button.click(print_transcript, outputs=download_file)
|
214 |
|
215 |
if __name__ == '__main__':
|
216 |
+
Thread(target=start_server).start()
|
217 |
demo.launch()
|