reflex-google-auth 0.0.9a10__py3-none-any.whl → 0.0.9a11__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.
- reflex_google_auth/__init__.py +2 -2
- reflex_google_auth/decorator.py +0 -1
- reflex_google_auth/google_auth.py +6 -7
- reflex_google_auth/state.py +3 -5
- {reflex_google_auth-0.0.9a10.dist-info → reflex_google_auth-0.0.9a11.dist-info}/METADATA +3 -3
- reflex_google_auth-0.0.9a11.dist-info/RECORD +8 -0
- reflex_google_auth-0.0.9a10.dist-info/RECORD +0 -8
- {reflex_google_auth-0.0.9a10.dist-info → reflex_google_auth-0.0.9a11.dist-info}/WHEEL +0 -0
- {reflex_google_auth-0.0.9a10.dist-info → reflex_google_auth-0.0.9a11.dist-info}/top_level.txt +0 -0
reflex_google_auth/__init__.py
CHANGED
reflex_google_auth/decorator.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
from typing import cast
|
2
|
+
|
2
3
|
import reflex as rx
|
3
|
-
from reflex.event import EventType
|
4
|
+
from reflex.event import EventType
|
4
5
|
|
5
6
|
from .state import GoogleAuthState
|
6
7
|
|
7
|
-
|
8
8
|
LIBRARY = "@react-oauth/google"
|
9
9
|
|
10
10
|
|
@@ -43,11 +43,10 @@ google_login = GoogleLogin.create
|
|
43
43
|
|
44
44
|
|
45
45
|
def handle_google_login(
|
46
|
-
on_success: EventType[
|
46
|
+
on_success: EventType[dict] = GoogleAuthState.on_success,
|
47
47
|
) -> rx.Var[rx.EventChain]:
|
48
48
|
on_success_event_chain = rx.Var.create(
|
49
|
-
|
50
|
-
rx.Component()._create_event_chain(
|
49
|
+
rx.EventChain.create(
|
51
50
|
value=on_success, # type: ignore
|
52
51
|
args_spec=_on_success_signature,
|
53
52
|
key="on_success",
|
@@ -63,8 +62,8 @@ const login = useGoogleLogin({
|
|
63
62
|
onSuccess: %s,
|
64
63
|
flow: 'auth-code',
|
65
64
|
});"""
|
66
|
-
% on_success_event_chain:
|
65
|
+
% on_success_event_chain: on_success_event_chain._get_all_var_data(),
|
67
66
|
},
|
68
67
|
imports={LIBRARY: "useGoogleLogin"},
|
69
|
-
)
|
68
|
+
),
|
70
69
|
)
|
reflex_google_auth/state.py
CHANGED
@@ -4,13 +4,11 @@ import json
|
|
4
4
|
import os
|
5
5
|
import time
|
6
6
|
|
7
|
+
import reflex as rx
|
7
8
|
from google.auth.transport import requests
|
8
9
|
from google.oauth2.id_token import verify_oauth2_token
|
9
10
|
from httpx import AsyncClient
|
10
11
|
|
11
|
-
import reflex as rx
|
12
|
-
|
13
|
-
|
14
12
|
TOKEN_URI = "https://oauth2.googleapis.com/token"
|
15
13
|
CLIENT_ID = os.environ.get("GOOGLE_CLIENT_ID", "")
|
16
14
|
CLIENT_SECRET = os.environ.get("GOOGLE_CLIENT_SECRET", "")
|
@@ -72,7 +70,7 @@ class GoogleAuthState(rx.State):
|
|
72
70
|
)
|
73
71
|
except Exception as exc:
|
74
72
|
if self.id_token_json:
|
75
|
-
print(f"Error verifying token: {exc!r}")
|
73
|
+
print(f"Error verifying token: {exc!r}") # noqa: T201
|
76
74
|
self.id_token_json = ""
|
77
75
|
return {}
|
78
76
|
|
@@ -80,7 +78,7 @@ class GoogleAuthState(rx.State):
|
|
80
78
|
def logout(self):
|
81
79
|
self.id_token_json = ""
|
82
80
|
|
83
|
-
@rx.var
|
81
|
+
@rx.var(cache=False)
|
84
82
|
def token_is_valid(self) -> bool:
|
85
83
|
try:
|
86
84
|
return bool(
|
@@ -1,15 +1,15 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: reflex-google-auth
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.9a11
|
4
4
|
Summary: Sign in with Google
|
5
5
|
Author-email: Masen Furer <m_github@0x26.net>
|
6
6
|
License: Apache-2.0
|
7
7
|
Project-URL: homepage, https://github.com/masenf/reflex-google-auth
|
8
8
|
Keywords: reflex,reflex-custom-components
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
10
|
-
Requires-Python: >=3.
|
10
|
+
Requires-Python: >=3.10
|
11
11
|
Description-Content-Type: text/markdown
|
12
|
-
Requires-Dist: reflex>=0.
|
12
|
+
Requires-Dist: reflex>=0.7.0a2
|
13
13
|
Requires-Dist: google-auth[requests]
|
14
14
|
Provides-Extra: dev
|
15
15
|
Requires-Dist: build; extra == "dev"
|
@@ -0,0 +1,8 @@
|
|
1
|
+
reflex_google_auth/__init__.py,sha256=A3PO7fwBSKoX2nPN5JohqrnZ1cu9nLaP5JsLR9SjbZI,339
|
2
|
+
reflex_google_auth/decorator.py,sha256=xjlC4AgU5lX4CyTjM67hTQUFIc_0I1JBC8V4CqvJtM0,1763
|
3
|
+
reflex_google_auth/google_auth.py,sha256=PG2QUFcCVQDtUKGqfJ0DabrIOvO6jthNxdXWPPoB-8Y,1696
|
4
|
+
reflex_google_auth/state.py,sha256=-rQTvZjkUYiOgYzUkEJNwgMY7V2lgDLA4D94yNUmHQ8,2691
|
5
|
+
reflex_google_auth-0.0.9a11.dist-info/METADATA,sha256=iNwE_Cl3TlMB5jUI4hEVHpY6zeBxkqca47yuP7eToVE,4862
|
6
|
+
reflex_google_auth-0.0.9a11.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
7
|
+
reflex_google_auth-0.0.9a11.dist-info/top_level.txt,sha256=JB7Letu_7VOfOx5EhyGn_bElQjzSq43-LHafE90wqyM,19
|
8
|
+
reflex_google_auth-0.0.9a11.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
reflex_google_auth/__init__.py,sha256=FAe5v8HmISOr_GbwZ6MsR01D5ciR_CAJnjpf_t7So38,339
|
2
|
-
reflex_google_auth/decorator.py,sha256=qXY5OmW8b6U5B0JxSu8hRs98rdPoRQHTkKBGMrBPf7s,1764
|
3
|
-
reflex_google_auth/google_auth.py,sha256=2hqiGIgIdyweE6bCooHaXsqpbte-4T3DgrS6o6EnJEk,1786
|
4
|
-
reflex_google_auth/state.py,sha256=ZwJIOsAUNJEvFp6s-GxIhdEwwE5r_3GxMY0PPiac3r0,2666
|
5
|
-
reflex_google_auth-0.0.9a10.dist-info/METADATA,sha256=TWdjOf3Rz8dKjEggEZv20QXddYmeAWB9Emui9R6qqSg,4859
|
6
|
-
reflex_google_auth-0.0.9a10.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
7
|
-
reflex_google_auth-0.0.9a10.dist-info/top_level.txt,sha256=JB7Letu_7VOfOx5EhyGn_bElQjzSq43-LHafE90wqyM,19
|
8
|
-
reflex_google_auth-0.0.9a10.dist-info/RECORD,,
|
File without changes
|
{reflex_google_auth-0.0.9a10.dist-info → reflex_google_auth-0.0.9a11.dist-info}/top_level.txt
RENAMED
File without changes
|