mirror of https://gitlab.crans.org/bde/nk20
Support multiple addresses for IP-based connection (useful when using IPv4/IPv6 and for ENS -> Crans transition)
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
048266ed61
commit
d965732b65
|
@ -75,7 +75,7 @@ class LoginByIPMiddleware(object):
|
|||
else:
|
||||
ip = request.META.get('REMOTE_ADDR')
|
||||
|
||||
qs = User.objects.filter(password=f"ipbased${ip}")
|
||||
qs = User.objects.filter(password__iregex=f"ipbased\\$.*\\^{ip}\\$.*")
|
||||
if qs.exists():
|
||||
login(request, qs.get())
|
||||
session = request.session
|
||||
|
|
Loading…
Reference in New Issue