From 11893fd78d6aeb03e1c53f83f4a2bfb44da3f675 Mon Sep 17 00:00:00 2001 From: James Emerton Date: Wed, 7 Apr 2021 14:07:27 -0700 Subject: [PATCH 1/2] Fix typo --- loginpass/_django.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loginpass/_django.py b/loginpass/_django.py index 4a1e02b..dcaa821 100644 --- a/loginpass/_django.py +++ b/loginpass/_django.py @@ -74,6 +74,6 @@ def login(request): redirect_uri = request.build_absolute_uri(reverse(auth_route_name)) params = {} if authorize_params: - params.udpate(authorize_params) + params.update(authorize_params) return remote.authorize_redirect(request, redirect_uri, **params) return login From 845931339c119283736ad67e898f532062b703b5 Mon Sep 17 00:00:00 2001 From: James Emerton Date: Wed, 7 Apr 2021 14:35:12 -0700 Subject: [PATCH 2/2] Pass `next` urlparam to auth endpoint --- loginpass/_django.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/loginpass/_django.py b/loginpass/_django.py index dcaa821..3619bc8 100644 --- a/loginpass/_django.py +++ b/loginpass/_django.py @@ -60,6 +60,7 @@ def auth(request): def create_login_endpoint(remote, backend, auth_route_name): + from urllib.parse import urlencode from django.conf import settings from django.urls import reverse @@ -72,6 +73,9 @@ def create_login_endpoint(remote, backend, auth_route_name): def login(request): redirect_uri = request.build_absolute_uri(reverse(auth_route_name)) + if 'next' in request.GET: + redirect_uri += '?'+urlencode({'next': request.GET['next']}) + params = {} if authorize_params: params.update(authorize_params)