0002-auth_fc-check-request-and-session-exist-in-hooks-429.patch
src/authentic2_auth_fc/__init__.py | ||
---|---|---|
93 | 93 |
def a2_hook_user_can_change_password(self, user, request, **kwargs): |
94 | 94 |
from authentic2.utils import get_authentication_events |
95 | 95 | |
96 |
if 'fc_id_token' in request.session: |
|
96 |
if not request: |
|
97 |
return True |
|
98 |
try: |
|
99 |
session = request.session |
|
100 |
except AttributeError: |
|
101 |
return True |
|
102 |
if session and 'fc_id_token' in session: |
|
97 | 103 |
for authentication_event in get_authentication_events(request=request): |
98 | 104 |
if authentication_event['how'] == 'france-connect': |
99 | 105 |
return False |
100 |
- |