Fix next url when there is only one org
1 files changed, 2 insertions(+), 0 deletions(-)

M nlotp/middleware.py
M nlotp/middleware.py +2 -0
@@ 31,6 31,8 @@ class OTPCheckMiddleware(OTPMiddleware, 
                     return None
             if request.path not in settings.NLOTP_VERIFY_EXCLUDED_URLS:
                 next_url = request.GET.get(REDIRECT_FIELD_NAME)
+                if not next_url:
+                    next_url = request.path
                 return HttpResponseRedirect(
                     '{0}?{1}={2}'.format(settings.NLOTP_VERIFY_URL,
                                          REDIRECT_FIELD_NAME, next_url)