Commit a3308dcc authored by Siddhant Sanyam's avatar Siddhant Sanyam

Changed the weird looking Auth headers to simple username and password

parent 8a995ab9
...@@ -37,12 +37,11 @@ currentTime = function() {return (new Date()).toUTCString();} ...@@ -37,12 +37,11 @@ currentTime = function() {return (new Date()).toUTCString();}
// save // save
saveXHR = function(address) { saveXHR = function(address) {
alert("Saving"+address);
$.ajax({ $.ajax({
url: address, url: address,
type: "PUT", type: "PUT",
headers: {Authorization: "Basic "+btoa("smik"+ ':' +"asdf")}, username: "smik",
fields: {withCredentials: "true"}, password: "asdf",
data: JSON.stringify(getCurrentDocument()), data: JSON.stringify(getCurrentDocument()),
success: function(){alert("saved");}, success: function(){alert("saved");},
error: function(xhr) { alert("error while saving");} error: function(xhr) { alert("error while saving");}
...@@ -54,7 +53,7 @@ loadXHR = function(address) { ...@@ -54,7 +53,7 @@ loadXHR = function(address) {
url: address, url: address,
type: "GET", type: "GET",
cache:false, cache:false,
/* username: "smik", /* username: "smik", No need to specify credential while GETTING
password: "asdf",*/ password: "asdf",*/
success: function(data){ success: function(data){
var cDoc = getCurrentDocument(); var cDoc = getCurrentDocument();
......
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