reflex-google-auth 0.0.5__py3-none-any.whl → 0.0.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ from google.oauth2.id_token import verify_oauth2_token
10
10
  import reflex as rx
11
11
 
12
12
 
13
- CLIENT_ID = os.environ.get("GOOGLE_CLIENT_ID", "")
13
+ CLIENT_ID = None
14
14
 
15
15
 
16
16
  def set_client_id(client_id: str):
@@ -25,11 +25,11 @@ class GoogleAuthState(rx.State):
25
25
  def on_success(self, id_token: dict):
26
26
  self.id_token_json = json.dumps(id_token)
27
27
 
28
- @rx.cached_var
28
+ @rx.var(cache=True)
29
29
  def client_id(self) -> str:
30
- return CLIENT_ID
30
+ return CLIENT_ID or os.environ.get("GOOGLE_CLIENT_ID", "")
31
31
 
32
- @rx.cached_var
32
+ @rx.var(cache=True)
33
33
  def tokeninfo(self) -> dict[str, str]:
34
34
  try:
35
35
  return verify_oauth2_token(
@@ -54,10 +54,10 @@ class GoogleAuthState(rx.State):
54
54
  except Exception:
55
55
  return False
56
56
 
57
- @rx.cached_var
57
+ @rx.var(cache=True)
58
58
  def user_name(self) -> str:
59
59
  return self.tokeninfo.get("name", "")
60
60
 
61
- @rx.cached_var
61
+ @rx.var(cache=True)
62
62
  def user_email(self) -> str:
63
63
  return self.tokeninfo.get("email", "")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: reflex-google-auth
3
- Version: 0.0.5
3
+ Version: 0.0.6
4
4
  Summary: Sign in with Google
5
5
  Author-email: Masen Furer <m_github@0x26.net>
6
6
  License: Apache-2.0
@@ -9,11 +9,11 @@ Keywords: reflex,reflex-custom-components
9
9
  Classifier: Development Status :: 4 - Beta
10
10
  Requires-Python: >=3.8
11
11
  Description-Content-Type: text/markdown
12
- Requires-Dist: reflex >=0.4.6
12
+ Requires-Dist: reflex>=0.4.6
13
13
  Requires-Dist: google-auth[requests]
14
14
  Provides-Extra: dev
15
- Requires-Dist: build ; extra == 'dev'
16
- Requires-Dist: twine ; extra == 'dev'
15
+ Requires-Dist: build; extra == "dev"
16
+ Requires-Dist: twine; extra == "dev"
17
17
 
18
18
  # google-auth
19
19
 
@@ -59,7 +59,7 @@ from reflex_google_auth import GoogleAuthState, require_google_login
59
59
 
60
60
 
61
61
  class State(GoogleAuthState):
62
- @rx.cached_var
62
+ @rx.var(cache=True)
63
63
  def protected_content(self) -> str:
64
64
  if self.token_is_valid:
65
65
  return f"This content can only be viewed by a logged in User. Nice to see you {self.tokeninfo['name']}"
@@ -0,0 +1,8 @@
1
+ reflex_google_auth/__init__.py,sha256=StBRDVUPCsMwOVRRgvb_WdzoDkSZoq2RLOoe-YsBExE,291
2
+ reflex_google_auth/decorator.py,sha256=70gaOYTupWTE1m0hd2D8TvcoP0CUNVxtBdezurzXtMM,594
3
+ reflex_google_auth/google_auth.py,sha256=gEL68F4M77gS5bfG4GVojvIuq8fKx8XpAQ1cIIU6-pk,794
4
+ reflex_google_auth/state.py,sha256=IVsHpaI-ahcVNWTCyZGzA9g9mbcansKH3wrxGCV17R0,1514
5
+ reflex_google_auth-0.0.6.dist-info/METADATA,sha256=LThWAPOIhA7ujUweuhOIefAcDKnAVD1iBjI_cb1stYI,3337
6
+ reflex_google_auth-0.0.6.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
7
+ reflex_google_auth-0.0.6.dist-info/top_level.txt,sha256=JB7Letu_7VOfOx5EhyGn_bElQjzSq43-LHafE90wqyM,19
8
+ reflex_google_auth-0.0.6.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,8 +0,0 @@
1
- reflex_google_auth/__init__.py,sha256=StBRDVUPCsMwOVRRgvb_WdzoDkSZoq2RLOoe-YsBExE,291
2
- reflex_google_auth/decorator.py,sha256=70gaOYTupWTE1m0hd2D8TvcoP0CUNVxtBdezurzXtMM,594
3
- reflex_google_auth/google_auth.py,sha256=gEL68F4M77gS5bfG4GVojvIuq8fKx8XpAQ1cIIU6-pk,794
4
- reflex_google_auth/state.py,sha256=q3C-tb4z4wfKCbRLsJ6JJuVy1MrTGptYnobo1jyKmuU,1486
5
- reflex_google_auth-0.0.5.dist-info/METADATA,sha256=c9Y_Ft5CcWZ5DLkIHqXCZPMM7s4V_WIWmkXHfr4qJ94,3335
6
- reflex_google_auth-0.0.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
7
- reflex_google_auth-0.0.5.dist-info/top_level.txt,sha256=JB7Letu_7VOfOx5EhyGn_bElQjzSq43-LHafE90wqyM,19
8
- reflex_google_auth-0.0.5.dist-info/RECORD,,