Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)authenticateWithCallback:(Function)aCallback
- {
- var request = new CFHTTPRequest();
- request.open("POST", BASE_URL+"login/simpleAjaxAuth?j_username="+encodeURIComponent(username)+"&j_password="+encodeURIComponent(authenticationToken), true);
- request.oncomplete = function()
- {
- var s=request.success();
- alert(s);
- if (request.success())
- {
- alert(request.responseText());
- var response = [request.responseText() objectFromJSON];
- success=response.success;
- alert(response);
- if(success)
- {
- [[CPUserSessionManager defaultManager] setStatus:CPUserSessionLoggedInStatus];
- alert("Success");
- } else
- {
- alert("Fail");
- }
- }
- }
- request.send("");
- }
Add Comment
Please, Sign In to add comment