Commit f667635c authored by Xavier Guimard's avatar Xavier Guimard

Fixes: #1408 (missing make minify)

parent 4f6cb5fe
Pipeline #1365 passed with stage
in 2 minutes and 23 seconds
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.12.7
/*
LemonLDAP::NG TOTP registration script
*/
(function() {
var displayError, getKey, register, setMsg, token;
var displayError, getKey, setMsg, token, verify;
setMsg = function(msg, level) {
$('#msg').html(window.translate(msg));
......@@ -71,7 +71,7 @@ LemonLDAP::NG TOTP registration script
});
};
register = function() {
verify = function() {
var val;
val = $('#code').val();
if (!val) {
......@@ -79,7 +79,7 @@ LemonLDAP::NG TOTP registration script
} else {
return $.ajax({
type: "POST",
url: portal + "/2fregisters/totp/register",
url: portal + "/2fregisters/totp/verify",
dataType: 'json',
data: {
token: token,
......@@ -107,8 +107,8 @@ LemonLDAP::NG TOTP registration script
$('#changekey').on('click', function() {
return getKey(1);
});
return $('#register').on('click', function() {
return register();
return $('#verify').on('click', function() {
return verify();
});
});
......
(function(){var a,b,d,e,c;e=function(f,g){$("#msg").html(window.translate(f));$("#color").removeClass("message-positive message-warning message-danger alert-success alert-warning alert-danger");$("#color").addClass("message-"+g);if(g==="positive"){g="success"}return $("#color").addClass("alert-"+g)};a=function(g,f,i){var h;console.log("Error",i);h=JSON.parse(g.responseText);if(h&&h.error){h=h.error.replace(/.* /,"");console.log("Returned error",h);return e(h,"warning")}};c="";b=function(f){e("yourTotpKey","warning");return $.ajax({type:"POST",url:portal+"/2fregisters/totp/getkey",dataType:"json",data:{newkey:f},error:a,success:function(i){var g,h;if(i.error){return e(i.error,"warning")}if(!(i.portal&&i.user&&i.secret)){return e("PE24","danger")}h="otpauth://totp/"+(escape(i.portal))+":"+(escape(i.user))+"?secret="+i.secret+"&issuer="+(escape(i.portal));if(i.digits!==6){h+="&digits="+i.digits}if(i.interval!==30){h+="&period="+i.interval}g=new QRious({element:document.getElementById("qr"),value:h,size:150});$("#serialized").text(h);if(i.newkey){e("yourNewTotpKey","warning")}else{e("yourTotpKey","success")}return c=i.token}})};d=function(){var f;f=$("#code").val();if(!f){return e("fillTheForm","warning")}else{return $.ajax({type:"POST",url:portal+"/2fregisters/totp/register",dataType:"json",data:{token:c,code:f,TOTPName:$("#TOTPName").val()},error:a,success:function(g){if(g.error){if(g.error.match(/badCode/)){return e("badCode","warning")}else{return e(g.error,"danger")}}else{return e("yourKeyIsRegistered","success")}}})}};$(document).ready(function(){b(0);$("#changekey").on("click",function(){return b(1)});return $("#register").on("click",function(){return d()})})}).call(this);
\ No newline at end of file
(function(){var a,b,d,c,e;d=function(f,g){$("#msg").html(window.translate(f));$("#color").removeClass("message-positive message-warning message-danger alert-success alert-warning alert-danger");$("#color").addClass("message-"+g);if(g==="positive"){g="success"}return $("#color").addClass("alert-"+g)};a=function(g,f,i){var h;console.log("Error",i);h=JSON.parse(g.responseText);if(h&&h.error){h=h.error.replace(/.* /,"");console.log("Returned error",h);return d(h,"warning")}};c="";b=function(f){d("yourTotpKey","warning");return $.ajax({type:"POST",url:portal+"/2fregisters/totp/getkey",dataType:"json",data:{newkey:f},error:a,success:function(i){var g,h;if(i.error){return d(i.error,"warning")}if(!(i.portal&&i.user&&i.secret)){return d("PE24","danger")}h="otpauth://totp/"+(escape(i.portal))+":"+(escape(i.user))+"?secret="+i.secret+"&issuer="+(escape(i.portal));if(i.digits!==6){h+="&digits="+i.digits}if(i.interval!==30){h+="&period="+i.interval}g=new QRious({element:document.getElementById("qr"),value:h,size:150});$("#serialized").text(h);if(i.newkey){d("yourNewTotpKey","warning")}else{d("yourTotpKey","success")}return c=i.token}})};e=function(){var f;f=$("#code").val();if(!f){return d("fillTheForm","warning")}else{return $.ajax({type:"POST",url:portal+"/2fregisters/totp/verify",dataType:"json",data:{token:c,code:f,TOTPName:$("#TOTPName").val()},error:a,success:function(g){if(g.error){if(g.error.match(/badCode/)){return d("badCode","warning")}else{return d(g.error,"danger")}}else{return d("yourKeyIsRegistered","success")}}})}};$(document).ready(function(){b(0);$("#changekey").on("click",function(){return b(1)});return $("#verify").on("click",function(){return e()})})}).call(this);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment