reflex-google-auth 0.0.5__tar.gz → 0.0.6__tar.gz
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.
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/PKG-INFO +2 -2
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/README.md +1 -1
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/custom_components/reflex_google_auth/state.py +6 -6
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/custom_components/reflex_google_auth.egg-info/PKG-INFO +2 -2
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/pyproject.toml +1 -1
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/custom_components/reflex_google_auth/__init__.py +0 -0
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/custom_components/reflex_google_auth/decorator.py +0 -0
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/custom_components/reflex_google_auth/google_auth.py +0 -0
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/custom_components/reflex_google_auth.egg-info/SOURCES.txt +0 -0
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/custom_components/reflex_google_auth.egg-info/dependency_links.txt +0 -0
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/custom_components/reflex_google_auth.egg-info/requires.txt +0 -0
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/custom_components/reflex_google_auth.egg-info/top_level.txt +0 -0
- {reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: reflex-google-auth
|
3
|
-
Version: 0.0.
|
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
|
@@ -59,7 +59,7 @@ from reflex_google_auth import GoogleAuthState, require_google_login
|
|
59
59
|
|
60
60
|
|
61
61
|
class State(GoogleAuthState):
|
62
|
-
@rx.
|
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']}"
|
@@ -42,7 +42,7 @@ from reflex_google_auth import GoogleAuthState, require_google_login
|
|
42
42
|
|
43
43
|
|
44
44
|
class State(GoogleAuthState):
|
45
|
-
@rx.
|
45
|
+
@rx.var(cache=True)
|
46
46
|
def protected_content(self) -> str:
|
47
47
|
if self.token_is_valid:
|
48
48
|
return f"This content can only be viewed by a logged in User. Nice to see you {self.tokeninfo['name']}"
|
{reflex-google-auth-0.0.5 → reflex_google_auth-0.0.6}/custom_components/reflex_google_auth/state.py
RENAMED
@@ -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 =
|
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.
|
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.
|
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.
|
57
|
+
@rx.var(cache=True)
|
58
58
|
def user_name(self) -> str:
|
59
59
|
return self.tokeninfo.get("name", "")
|
60
60
|
|
61
|
-
@rx.
|
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.
|
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
|
@@ -59,7 +59,7 @@ from reflex_google_auth import GoogleAuthState, require_google_login
|
|
59
59
|
|
60
60
|
|
61
61
|
class State(GoogleAuthState):
|
62
|
-
@rx.
|
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']}"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|