Start better handle a missing uid with auto-login (still issues)
This commit is contained in:
parent
2e1ca526c6
commit
827b7214cd
1 changed files with 7 additions and 1 deletions
|
|
@ -34,7 +34,13 @@ def _shared_login(request):
|
||||||
if webclient_uid:
|
if webclient_uid:
|
||||||
# The webclient has previously registered a login to this browser_session
|
# The webclient has previously registered a login to this browser_session
|
||||||
if not account.is_authenticated() and not website_uid:
|
if not account.is_authenticated() and not website_uid:
|
||||||
|
try:
|
||||||
account = AccountDB.objects.get(id=webclient_uid)
|
account = AccountDB.objects.get(id=webclient_uid)
|
||||||
|
except AccountDB.DoesNotExist:
|
||||||
|
# this can happen e.g. for guest accounts or deletions
|
||||||
|
csession["website_authenticated_uid"] = False
|
||||||
|
csession["webclient_authenticated_uid"] = False
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
# calls our custom authenticate in web/utils/backends.py
|
# calls our custom authenticate in web/utils/backends.py
|
||||||
account = authenticate(autologin=account)
|
account = authenticate(autologin=account)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue