Skip to content

Commit

Permalink
providers/oauth2: launch url: if URL parsing fails, return no launch URL
Browse files Browse the repository at this point in the history
Signed-off-by: Marc 'risson' Schmitt <[email protected]>
  • Loading branch information
rissson committed Jun 9, 2023
1 parent 5873855 commit 21efb3e
Showing 1 changed file with 5 additions and 2 deletions.
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:
return None

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

0 comments on commit 21efb3e

Please sign in to comment.