Skip to content

Commit c45355c

Browse files
committed
feat: django-axes prefers forwarded ip address
Prioritize `HTTP_X_FORWARDED_FOR` for django-axes similar to audit logs with the get_client_ip. https://django-axes.readthedocs.io/en/latest/4_configuration.html#configuring-reverse-proxies Refs: PT-2026
1 parent 85d5def commit c45355c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

palvelutarjotin/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ def sentry_traces_sampler(sampling_context: SamplingContext) -> float:
447447

448448
AXES_FAILURE_LIMIT = 5
449449
AXES_COOLOFF_TIME = 1 # hour after locked out, user will be able to attempt login
450+
AXES_IPWARE_META_PRECEDENCE_ORDER = ["HTTP_X_FORWARDED_FOR", "REMOTE_ADDR"]
450451

451452
LOGGING = {
452453
"version": 1,

0 commit comments

Comments
 (0)