mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 15:21:13 +03:00
do not re-create django session on every request
* The django middleware call stack behavior is changed by DRF. As a result, during the process_request in sso/middlware.py request.user is not set as you would expect it to be set from the middleware django.contrib.auth.middleware.AuthenticationMiddleware
This commit is contained in:
parent
2bccb5e753
commit
45813bea16
@ -53,7 +53,7 @@ class SocialAuthMiddleware(SocialAuthExceptionMiddleware):
|
||||
|
||||
if not auth_token and request.user and request.user.is_authenticated():
|
||||
logout(request)
|
||||
elif auth_token and request.user != auth_token.user:
|
||||
elif auth_token and request.user.is_anonymous is False and request.user != auth_token.user:
|
||||
logout(request)
|
||||
auth_token.user.backend = ''
|
||||
login(request, auth_token.user)
|
||||
|
Loading…
Reference in New Issue
Block a user