Преглед на файлове

add link to one-tap example and remove client id

Rodja Trappe преди 2 месеца
родител
ревизия
6f699855e5
променени са 2 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 1 1
      examples/google_one_tap_auth/main.py
  2. 2 1
      website/examples.py

+ 1 - 1
examples/google_one_tap_auth/main.py

@@ -9,7 +9,7 @@ from nicegui import app, ui
 # For local development, you should add http://localhost:8080 to the authorized JavaScript origins.
 # In production, you should add the domain of your website to the authorized JavaScript origins.
 # See https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid#get_your_google_api_client_id.
-GOOGLE_CLIENT_ID = '484798726913-t4es9ner8aglom3miptbnq1m23dsqagi.apps.googleusercontent.com'
+GOOGLE_CLIENT_ID = '...'
 
 
 @ui.page('/')

+ 2 - 1
website/examples.py

@@ -13,7 +13,7 @@ class Example:
 
     def __post_init__(self) -> None:
         """Post-initialization hook."""
-        name = self.title.lower().replace(' ', '_')
+        name = self.title.lower().replace(' ', '_').replace('-', '_')
         content = [p for p in (PATH / name).glob('*') if not p.name.startswith(('__pycache__', '.', 'test_'))]
         filename = 'main.py' if len(content) == 1 else ''
         self.url = f'https://github.com/zauberzeug/nicegui/tree/main/examples/{name}/{filename}'
@@ -71,4 +71,5 @@ examples: List[Example] = [
     Example('Signature Pad', 'A custom element based on [signature_pad](https://www.npmjs.com/package/signature_pad'),
     Example('OpenAI Assistant', "Using OpenAI's Assistant API with async/await"),
     Example('Redis Storage', 'Use Redis storage to share data across multiple instances behind a reverse proxy or load balancer'),
+    Example('Google One-Tap Auth', 'Authenticate users via Google One-Tap'),
 ]