mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-12 23:05:12 +00:00
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:
@ -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':
|
||||
|
Reference in New Issue
Block a user