Skip to content

Instantly share code, notes, and snippets.

@stdavis
Created August 15, 2012 04:09
Show Gist options
  • Select an option

  • Save stdavis/3355770 to your computer and use it in GitHub Desktop.

Select an option

Save stdavis/3355770 to your computer and use it in GitHub Desktop.
login service code
window.CEM = {
// app: cem.App
// this is set in main.js
app: null,
urls: {
login: 'http://ec2-23-20-196-67.compute-1.amazonaws.com:8080/fishing/login',
getAvailableDownloads: 'http://ec2-23-20-196-67.compute-1.amazonaws.com:8080/fishing/json/AvailableDownloads',
downloadFile: 'http://ec2-23-20-196-67.compute-1.amazonaws.com:8080/fishing/file/download?fileId='
}
};
var params = {
url: CEM.urls.login,
handleAs: 'json',
headers: {
"Content-Type": "application/json",
"accept": "application/json",
"accept-charset": "ISO-8859-1,utf-8"
},
content: {
userId: 'test',
password: 'pass'
},
load: function(response) {
console.log('login response: ', response);
if (helpers.checkResponseForSuccess(response)) {
that.onSignInSuccess(response);
}
},
error: function(error) {
console.error('error with login xhr: ', error);
}
};
return dojo.xhrPost(par
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment