lemonldap-ng/lemonldap-ng-portal/example/skins/common/browseridlogin.js
Clément Oudot 9758223da8 For BrowserID (#584):
* Add autologin parameter
* Add a form in standard mode (not Choice) for display type logo
* Use POST instead of REDIRECT to keep all hidden fields
* Fix warning in unit test
2013-09-30 14:37:15 +00:00

27 lines
484 B
JavaScript

$(document).ready(function(){
// Manage auto login
if (browserIdAutoLogin.match('1')) {
launchRequest();
}
// Intercept submit the first time
var intercepted = 0;
$("form.login").submit(function( event ) {
if (!intercepted) {
event.preventDefault();
intercepted = 1;
launchRequest();
}
});
});
function launchRequest() {
navigator.id.request({
siteName: browserIdSiteName,
siteLogo: browserIdSiteLogo,
backgroundColor: browserIdBackgroundColor
});
}