Skip to content

Instantly share code, notes, and snippets.

@Vlasterx
Created March 26, 2024 10:15
Show Gist options
  • Save Vlasterx/37f0e16afd3e6d0944a5184e243e62b3 to your computer and use it in GitHub Desktop.
Save Vlasterx/37f0e16afd3e6d0944a5184e243e62b3 to your computer and use it in GitHub Desktop.
OLL Auth workaround
# Workaround for setting the redirect_uri to localhost.
# Host is set in proxy server.py and redirect_uri takes the request host value
# See https://github.com/openlawlibrary/platform/issues/4281
def get_redirect_uri(self, state=None):
"""Build redirect with redirect_state parameter."""
uri = self.redirect_uri
if self.REDIRECT_STATE and state:
uri = self.url_add_parameters(uri, {"redirect_state": state})
if settings.DEBUG:
return uri.replace('127.0.0.1', 'localhost')
return uri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment