From 5185b34f657b009b1d0ba9e97089794b446ddf6d Mon Sep 17 00:00:00 2001 From: Rafael Leira Date: Mon, 5 Jul 2021 16:37:42 +0200 Subject: [PATCH] on client.py reverse of simple-sso-authorize was not being performed --- simple_sso/sso_client/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/simple_sso/sso_client/client.py b/simple_sso/sso_client/client.py index c82e688..abd82d1 100644 --- a/simple_sso/sso_client/client.py +++ b/simple_sso/sso_client/client.py @@ -22,7 +22,11 @@ def get(self, request): path = reverse('simple-sso-authenticate') redirect_to = urlunparse((scheme, netloc, path, '', query, '')) request_token = self.client.get_request_token(redirect_to) - host = urljoin(self.client.server_url, 'authorize/') + try: + authorize_url = reverse('simple-sso-authorize') + except NoReverseMatch: + authorize_url = '/authorize/' + host = urljoin(self.client.server_url, authorize_url) url = '%s?%s' % (host, urlencode([('token', request_token)])) return HttpResponseRedirect(url)