mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
skip login for API requests when using REMOTE_AUTH_HEADER
This commit is contained in:
parent
ab0a1f0bbc
commit
6fed04c93c
@ -153,6 +153,10 @@ class RemoteUserMiddleware(RemoteUserMiddleware_):
|
||||
user.email = request.META[settings.REMOTE_AUTH_USER_EMAIL]
|
||||
user.save()
|
||||
|
||||
if request.META['PATH_INFO'].startswith('/api/'):
|
||||
# Skip login because API requests are authenticated by custom header
|
||||
return
|
||||
|
||||
# Set request.user and persist user in the session
|
||||
# by logging the user in.
|
||||
request.user = user
|
||||
|
Loading…
Reference in New Issue
Block a user