Skip to content

Commit c28d574

Browse files
authored
Merge pull request #3 from reflex-dev/use_query_parameters
use router.url.query_parameters
2 parents 9285f9d + 414392f commit c28d574

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ authors = [
1111
]
1212
dependencies = [
1313
"reflex-enterprise (>=0.3.0)",
14+
"reflex (>=0.8.4)",
1415
"httpx",
1516
"authlib",
1617
]

reflex_azure_auth/state.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import hashlib
66
import os
77
import secrets
8-
from urllib.parse import parse_qsl, urlencode, urlparse
8+
from urllib.parse import urlencode, urlparse
99

1010
import httpx
1111
import reflex as rx
@@ -141,10 +141,6 @@ def _index_uri(self) -> str:
141141
current_url = urlparse(self.router.url)
142142
return current_url._replace(path="/", query=None, fragment=None).geturl()
143143

144-
def _query_params(self) -> dict[str, str]:
145-
"""Retrieve the query parameters from url since router.page is deprecated."""
146-
return dict(parse_qsl(urlparse(self.router.url).query))
147-
148144
@rx.event
149145
async def redirect_to_login_popup(self):
150146
"""Open a small popup window to initiate the login flow.
@@ -241,7 +237,7 @@ async def auth_callback(self):
241237
and stores tokens for future use.
242238
"""
243239
headers = {"Content-Type": "application/x-www-form-urlencoded"}
244-
params = self._query_params()
240+
params = self.router.url.query_parameters
245241
code = params.get("code")
246242
app_state = params.get("state")
247243
if app_state != self._app_state:

0 commit comments

Comments
 (0)