Skip to content

Commit

Permalink
Update get_login_url_and_token method in LoginUrlModel to handle …
Browse files Browse the repository at this point in the history
…empty `ret_url` parameter

* Encode `ret_url` parameter as "%2F" if it is empty
  • Loading branch information
jlantz committed Oct 31, 2024
1 parent 628d135 commit 68f2e82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion d2x/models/sf/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class LoginUrlModel(CommonBaseModel):

def get_login_url_and_token(self) -> tuple[str, str]:
"""Generate login URL and token"""
ret_url_encoded = urllib.parse.quote(self.ret_url)
ret_url_encoded = urllib.parse.quote(self.ret_url) if self.ret_url else "%2F"
login_url_formatted = (
f"{self.login_url}/secur/frontdoor.jsp?sid={self.access_token}&retURL={ret_url_encoded}"
)
Expand Down

0 comments on commit 68f2e82

Please sign in to comment.