File tree 2 files changed +3
-8
lines changed
examples/google_one_tap_auth
2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
- import os
3
-
4
2
import httpx
5
- from dotenv import load_dotenv
6
3
from fastapi import Form , HTTPException
7
4
from fastapi .responses import RedirectResponse
8
5
9
6
from nicegui import app , ui
10
7
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.
12
9
# For local development, you should add http://localhost:8080 to the authorized JavaScript origins.
13
10
# In production, you should add the domain of your website to the authorized JavaScript origins.
14
11
# 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'
17
13
18
14
19
15
@ui .page ('/' )
@@ -47,4 +43,4 @@ async def google_auth(credential: str = Form(...)) -> RedirectResponse:
47
43
app .storage .user ['user_data' ] = response .json ()
48
44
return RedirectResponse ('/' , status_code = 303 )
49
45
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' )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments