Force login before giving community auth consent

In the normal workflow this would always happen, but if the user got to
the page without being logged in (probably most likely to happen if the
session timed out while waiting to proceed) we would crash on trying to
create an invalid consent record. Instead, force a re-login in this
case.
This commit is contained in:
Magnus Hagander
2018-06-25 16:43:59 +02:00
parent ff1222337a
commit c597b0288c

View File

@ -538,6 +538,7 @@ def communityauth_logout(request, siteid):
# Redirect user back to the specified suburl
return HttpResponseRedirect("%s?s=logout" % site.redirecturl)
@login_required
def communityauth_consent(request, siteid):
org = get_object_or_404(CommunityAuthSite, id=siteid).org
if request.method == 'POST':