0001-handle-form_submit_element-key-in-login-info-9477.patch
README | ||
---|---|---|
47 | 47 | |
48 | 48 |
SITE_DOMAIN = 'example.com' |
49 | 49 |
SITE_LOGIN_PATH = '/' |
50 |
SITE_HOME_PATH = '/profile' # Not required |
|
51 | 50 |
SITE_CA_URL = 'https://myidp/account/' # Citizen account |
52 | 51 |
|
53 | 52 |
SITE_LOCATORS = [ |
... | ... | |
94 | 93 |
# // your code |
95 | 94 |
# } |
96 | 95 |
# |
97 |
SITE_AUTH_CHECKER = 'js/vincennes_auth_checker.js'
|
|
96 |
SITE_AUTH_CHECKER = 'js/example.auth.checker.js'
|
|
98 | 97 | |
99 | 98 |
# JS/CSS for the association page (/_mandaye/associate) |
100 | 99 |
SITE_ASSOCIATE_STATIC = { |
101 | 100 |
'css': 'css/example_associate.css', |
102 | 101 |
'js': 'js/example_associate.js', |
103 | 102 |
} |
103 | ||
104 |
# DOM Element used to validate the logon form |
|
105 |
# If not provided, default is 'input[type=submit], button' |
|
106 |
SITE_FORM_SUBMIT_ELEMENT = 'button[type=submit]' |
|
104 | 107 |
|
105 | 108 |
# Mellon Settings |
106 | 109 |
MELLON_IDENTITY_PROVIDERS = [ |
mandayejs/do_login.js | ||
---|---|---|
57 | 57 |
} |
58 | 58 |
} |
59 | 59 |
} |
60 |
$(key).parents('form').find('input[type=submit]').click();
|
|
60 |
$(key).parents('form').find(input.form_submit_element).click();
|
|
61 | 61 |
}, input); |
62 | 62 |
}); |
mandayejs/mandaye/views.py | ||
---|---|---|
135 | 135 |
credentials = get_object_or_404(UserCredentials, user=request.user) |
136 | 136 |
site_static_root = os.path.join(getattr(settings, 'STATIC_ROOT'), getattr(settings, 'SITE_STATIC_ROOT_PATH', '')) |
137 | 137 |
site_auth_checker = getattr(settings, 'SITE_AUTH_CHECKER', '') |
138 |
site_form_submit_element = getattr(settings, 'SITE_FORM_SUBMIT_ELEMENT', 'input[type=submit], button') |
|
138 | 139 |
login_info = { |
139 | 140 |
'address': request.build_absolute_uri(settings.SITE_LOGIN_PATH), |
140 | 141 |
'cookies': [], |
141 | 142 |
'locators': [ credentials.to_login_info() ], |
142 |
'homepath': getattr(settings, 'SITE_HOME_PATH', '/'),
|
|
143 |
'form_submit_element': site_form_submit_element,
|
|
143 | 144 |
'auth_checker': os.path.join(site_static_root, site_auth_checker) |
144 | 145 |
} |
145 | 146 |
logger.debug(login_info) |
mandayejs/settings.py | ||
---|---|---|
56 | 56 |
'django.contrib.staticfiles', |
57 | 57 |
'mandayejs.mandaye', |
58 | 58 |
'mandayejs.sites.vincennes', |
59 |
'mandayejs.sites.montpellier3m', |
|
59 | 60 |
'gadjo', |
60 | 61 |
'mellon' |
61 | 62 |
) |
62 |
- |