@@ -193,6 +193,7 @@ and effectively log the user out of the app.
193193
194194``` python
195195import json
196+ from typing import Any
196197
197198class State (rx .State ):
198199 id_token_json: str = rx.LocalStorage()
@@ -201,7 +202,7 @@ class State(rx.State):
201202 self .id_token_json = json.dumps(id_token)
202203
203204 @rx.var (cache = True )
204- def tokeninfo (self ) -> dict[str , str ]:
205+ def tokeninfo (self ) -> dict[str , Any ]:
205206 try :
206207 return verify_oauth2_token(
207208 json.loads(self .id_token_json)[" credential" ],
@@ -347,9 +348,9 @@ def protected() -> rx.Component:
347348
348349## Putting the Pieces Together
349350
350- All of the code for this example is available in the
351- [ "google_auth" ] ( https://github.com/reflex-dev /reflex-examples/tree/a4ffe6cacf8f38b54b95b72b0d525a91b69da3b3/google_auth )
352- subdirectory inside the ` reflex-examples ` repo .
351+ The production code for this example has been published as a reuable third-party
352+ component, [ ` reflex-google-auth ` ] ( https://github.com/masenf /reflex-google-auth )
353+ and can be used directly in any Reflex app .
353354
354355### react_oauth_google.py
355356
@@ -378,6 +379,7 @@ import functools
378379import json
379380import os
380381import time
382+ from typing import Any
381383
382384from google.auth.transport import requests
383385from google.oauth2.id_token import verify_oauth2_token
@@ -396,7 +398,7 @@ class State(rx.State):
396398 self .id_token_json = json.dumps(id_token)
397399
398400 @rx.var (cache = True )
399- def tokeninfo (self ) -> dict[str , str ]:
401+ def tokeninfo (self ) -> dict[str , Any ]:
400402 try :
401403 return verify_oauth2_token(
402404 json.loads(self .id_token_json)[" credential" ],
0 commit comments