0003-auth_fc-make-autorun-go-directly-to-FranceConnect-UR.patch
src/authentic2_auth_fc/authenticators.py | ||
---|---|---|
21 | 21 |
from authentic2 import app_settings as a2_app_settings |
22 | 22 |
from authentic2.authenticators import BaseAuthenticator |
23 | 23 |
from authentic2.utils import misc as utils_misc |
24 |
from authentic2.utils.misc import redirect_to_login |
|
25 | 24 | |
26 | 25 |
from . import app_settings |
27 | 26 | |
... | ... | |
41 | 40 |
return 'fc' |
42 | 41 | |
43 | 42 |
def autorun(self, request, block_id): |
44 |
return redirect_to_login(request, login_url='fc-login-or-link') |
|
43 |
from . import views |
|
44 | ||
45 |
return views.LoginOrLinkView.as_view(display_message_on_redirect=True)(request) |
|
45 | 46 | |
46 | 47 |
def login(self, request, *args, **kwargs): |
47 | 48 |
if 'nofc' in request.GET: |
tests/auth_fc/test_auth_fc.py | ||
---|---|---|
78 | 78 |
# hide password block |
79 | 79 |
settings.AUTH_FRONTENDS_KWARGS = {'password': {'show_condition': 'remote_addr==\'0.0.0.0\''}} |
80 | 80 |
response = app.get('/login/') |
81 |
assert response.location == reverse('fc-login-or-link')
|
|
81 |
assert response.location.startswith('https://fcp')
|
|
82 | 82 | |
83 | 83 | |
84 | 84 |
def test_create(settings, app, franceconnect, hooks): |
85 |
- |