Commit bc4970bfff94feb845190bf91c57bb489d780169

  • avatar
  • arvind
  • Thu Feb 20 19:02:01 IST 2014
Removing dependency on authenticate script to be served from another domain.
alipi/ui.js
(14 / 2)
  
597597 {
598598 text: 'Login',
599599 click: function() {
600
600601 console.log('login');
601602 var uname = $('#tar-uname').val();
602603 var pass = $('#tar-pass').val();
603604 if(uname && pass) {
604605 $('.login-button > .ui-button-text').text('Please wait..');
605 sweet.authenticate(config.sweet + '/authenticate', uname, pass, a11ypi.publish, function() {
606 $.ajax({
607 crossDomain: true,
608 type: "POST",
609 url: config.sweet+"/authenticate",
610 data: {"user":uname, "hash":pass},
611 error: function(e, a, b){
612 console.log(e,a,b);
613
614 }
615 }).done(function(data){
606616 $('.login-button > .ui-button-text').text('Login');
607 });
617 a11ypi.publish();
618 });
619
608620 }
609621 else {
610622 //console.log('no username and password');