Skip to content

Commit

Permalink
- Fixed dispatch for NiceGUI
Browse files Browse the repository at this point in the history
  • Loading branch information
juanpablo.manson committed May 24, 2024
1 parent babbd0f commit 04a47a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions EasyOIDC/frameworks/nicegui.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,12 @@ async def dispatch(self, request: Request, call_next):
del self.session_storage[session_state]
# Check if the requested path matches with unrestricted_page_routes.
if not page_unrestricted:
self.nicegui_app.storage.user[REFERRER_VAR_NAME] = '/' if request.url.path is None else request.url.path
path_without_domain = request.url.path + ('?' + request.url.query if request.url.query else '')
self.nicegui_app.storage.user[REFERRER_VAR_NAME] = '/' if path_without_domain is None \
else path_without_domain
if self.log_enabled:
self.logger.debug(f"After login will redirect to '{request.url.path}'")
self.logger.debug(
f"After login will redirect to '{self.nicegui_app.storage.user[REFERRER_VAR_NAME]}'")
return RedirectResponse(login_route)
else:
referrer_path = self.nicegui_app.storage.user.get(REFERRER_VAR_NAME, '')
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="EasyOIDC",
version="0.1.9",
version="0.1.10",
author="Juan Pablo Manson",
author_email="[email protected]",
description="Easy integration with OIDC authentication servers",
Expand Down

0 comments on commit 04a47a2

Please sign in to comment.