PhoneGap Parse JS function exit function returns 404

I am developing a PhoneGap + Parse application.

I have a login page and an exit button. I call the following code when I click the logout button.

$('#signout').click(function(event){ $(":mobile-pagecontainer").pagecontainer("change", "#signin", { reload:true, transition:'flow', changeHash:true }); Parse.User.logOut(); console.log('logged out'); }); 

I get the following message in the browser console.

 POST http://192.168.2.2:3000/proxy/https%3A%2F%2Fapi.parse.com%2F1%2Flogin 404 (Not Found) 

What does it mean? What needs to be fixed for the logout function to work properly?

+6
source share
3 answers
 $('#signout').click(function (event) { $(":mobile-pagecontainer").pagecontainer("change", "#signin", { reload : true, transition : 'flow', changeHash : true, beforechange : function (event, ui) { Parse.User.logOut(); console.log('logged out'); } }); }); 

Did not check this, but using beforechange can help you log out of Parse and then go to the login page.

0
source
 $('#signout').on('click',function(event){ event.preventDefault(); Parse.User.logOut(); $(":mobile-pagecontainer").pagecontainer("change", "#signin", { reload:true, transition:'flow', changeHash:true }); console.log('logged out'); }); 
0
source

re POST for login ...

I think you want your framework (jquery / cordova) to produce GET, not POST.

In addition, GET will require the following headings and perfumes

 -H "X-Parse-Application-Id: AbR" \ -H "X-Parse-REST-API-Key: uI9" \ -H "X-Parse-Revocable-Session: 1" \ -G \ --data-urlencode 'username=e6' \ --data-urlencode 'password=e8' 

above from parse, the REST guide applies to what you have in WIRE through the http protocol and in your console log.

So, in your frame code, before any get problems, you will need urlEncode both username and password.

Then add the query line below.

 ?username=$encodedNameVal&password=$encodedPasswrdVal 

to the end of the domain / path you pass to GET ...

 api.parse.com/1/login 

not familiar with PG, but I don't need to understand 404 U.

0
source

All Articles