2020-01-15 22:12:02 +01:00
|
|
|
// Generated by CoffeeScript 1.12.7
|
2019-02-01 23:22:11 +01:00
|
|
|
(function() {
|
2019-07-30 21:58:04 +02:00
|
|
|
var sendUrl, tryssl;
|
2019-02-01 23:22:11 +01:00
|
|
|
|
|
|
|
tryssl = function() {
|
2019-07-30 21:58:04 +02:00
|
|
|
var path;
|
2019-07-09 10:34:46 +02:00
|
|
|
path = window.location.pathname;
|
2019-07-30 21:58:04 +02:00
|
|
|
console.log('path -> ', path);
|
|
|
|
console.log('Call URL -> ', window.datas.sslHost);
|
|
|
|
$.ajax(window.datas.sslHost, {
|
2020-03-26 20:21:09 +01:00
|
|
|
dataType: 'json',
|
|
|
|
xhrFields: {
|
|
|
|
withCredentials: true
|
2019-02-01 23:22:11 +01:00
|
|
|
},
|
|
|
|
success: function(data) {
|
2019-07-30 21:58:04 +02:00
|
|
|
sendUrl(path);
|
2019-02-01 23:22:11 +01:00
|
|
|
return console.log('Success -> ', data);
|
|
|
|
},
|
2020-03-26 20:21:09 +01:00
|
|
|
error: function(result) {
|
|
|
|
if (result.status === 0) {
|
|
|
|
sendUrl(path);
|
|
|
|
}
|
|
|
|
if (result.responseJSON && 'error' in result.responseJSON && result.responseJSON.error === "9") {
|
|
|
|
sendUrl(path);
|
|
|
|
}
|
|
|
|
if (result.responseJSON && 'html' in result.responseJSON) {
|
|
|
|
$('#errormsg').html(result.responseJSON.html);
|
|
|
|
$(window).trigger('load');
|
|
|
|
}
|
|
|
|
return console.log('Error during AJAX SSL authentication', result);
|
2019-02-01 23:22:11 +01:00
|
|
|
}
|
|
|
|
});
|
2019-06-27 16:40:56 +02:00
|
|
|
return false;
|
2019-02-01 23:22:11 +01:00
|
|
|
};
|
|
|
|
|
2019-07-30 21:58:04 +02:00
|
|
|
sendUrl = function(path) {
|
|
|
|
var form_url;
|
|
|
|
form_url = $('#lformSSL').attr('action');
|
|
|
|
if (form_url.match(/^#$/)) {
|
|
|
|
form_url = path;
|
|
|
|
} else {
|
|
|
|
form_url = form_url + path;
|
|
|
|
}
|
|
|
|
console.log('form action URL -> ', form_url);
|
|
|
|
$('#lformSSL').attr('action', form_url);
|
|
|
|
return $('#lformSSL').submit();
|
|
|
|
};
|
|
|
|
|
2019-02-01 23:22:11 +01:00
|
|
|
$(document).ready(function() {
|
|
|
|
return $('.sslclick').on('click', tryssl);
|
|
|
|
});
|
|
|
|
|
|
|
|
}).call(this);
|