fix auto-login debugging middleware to only apply to localhost or 127.0.0.1
This commit is contained in:
parent
71b3993326
commit
80da7be559
1 changed files with 1 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ class AutoLoginMiddleware:
|
|||
|
||||
def __call__(self, request):
|
||||
# Only perform auto-login if in DEBUG mode and user is not authenticated.
|
||||
if settings.DEBUG and not request.user.is_authenticated:
|
||||
if settings.DEBUG and not request.user.is_authenticated and request.host in ['pocket-trade.fly.dev', 'localhost', '127.0.0.1']:
|
||||
user = CustomUser.objects.get(email='rob@badblocks.email')
|
||||
login(request, user, backend='django.contrib.auth.backends.ModelBackend')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue