Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
providers/oauth2: launch url: if URL parsing fails, return no launch URL
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
  • Loading branch information
rissson committed Jun 9, 2023
commit d11a2b52b70938ee960275edcd07dd458772e04c
7 changes: 5 additions & 2 deletions authentik/providers/oauth2/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,11 @@ def launch_url(self) -> Optional[str]:
if self.redirect_uris == "":
return None
main_url = self.redirect_uris.split("\n", maxsplit=1)[0]
launch_url = urlparse(main_url)._replace(path="")
return urlunparse(launch_url)
try:
launch_url = urlparse(main_url)._replace(path="")
return urlunparse(launch_url)
except ValueError:
return None

@property
def component(self) -> str:
Expand Down