Skip to content

Commit ed321e1

Browse files
remove dotenv dependency; open app on "localhost"
1 parent 6ed1442 commit ed321e1

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

examples/google_one_tap_auth/main.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
#!/usr/bin/env python3
2-
import os
3-
42
import httpx
5-
from dotenv import load_dotenv
63
from fastapi import Form, HTTPException
74
from fastapi.responses import RedirectResponse
85

96
from nicegui import app, ui
107

11-
# Get your Google Client ID from the Google Cloud Console and pass it as an environment variable (or write it to an .env file)
8+
# Get your Google Client ID from the Google Cloud Console.
129
# For local development, you should add http://localhost:8080 to the authorized JavaScript origins.
1310
# In production, you should add the domain of your website to the authorized JavaScript origins.
1411
# See https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid#get_your_google_api_client_id.
15-
load_dotenv()
16-
GOOGLE_CLIENT_ID = os.environ.get('GOOGLE_CLIENT_ID', '')
12+
GOOGLE_CLIENT_ID = '484798726913-t4es9ner8aglom3miptbnq1m23dsqagi.apps.googleusercontent.com'
1713

1814

1915
@ui.page('/')
@@ -47,4 +43,4 @@ async def google_auth(credential: str = Form(...)) -> RedirectResponse:
4743
app.storage.user['user_data'] = response.json()
4844
return RedirectResponse('/', status_code=303)
4945

50-
ui.run(storage_secret='here you should pick a random secret string for your app')
46+
ui.run(host='localhost', storage_secret='here you should pick a random secret string for your app')

examples/google_one_tap_auth/requirements.txt

-1
This file was deleted.

0 commit comments

Comments
 (0)