Hello All,
I am facing issue with Drupalgap, when i try to login with correct user name and password it reload page with all success API calls but user object still have uid 0. i have tried to debug the API calls manually and found that drupalgap/user/login.json is working fine and returning correct user object and just after that its calling drupalgap/system/connect.json that is returning token thats also successful but after that it will show uid 0 for user object. due to this reason system considering user as anonymous.
FYI: I am developing app from my localhost but the website is hosted on other server with sub-domain (Virtual Host) And I can successfully login and app works fine if i try using web-app from sub-domain.
Please help me to get rid of this.
Thanks
Comments
Comment #2
tyler.frankenstein commentedMost likely a CORS issue, I'd recommend reading up on CORS+Services|DrupalGap.
Comment #3
drupal786 commentedI have setup cores and everything that is listed in troubleshooting section but still not working.
Comment #4
drupal786 commentedI have also debugged and found that, at the time of login either by using Ripple or by PhoneGap Server IP its calling drupalgap/user/login.json and its returning correct data with actual uidm, but just after that drupalgap also call drupalgap/system/connect.json that is returning uid 0 always so due to this reason page reload and back to anonymous page or login page.
Comment #5
bduell commented@drupal786 I'm having this same issue. Were you able to determine what it was?
Thanks!
Comment #6
bduell commented@drupal786, along with CORS being setup on my Drupal server, I was able to get logins with cookies in the app on ios working by having the following environment:
cordova 9.0.0 (cordova-lib@9.0.1)
cordova-ios@5.1.1 (this doesn't work with cordova-ios@6+)
And along with my other phonegap plugins I needed these:
The key was this module that needs the following code at the bottom of your index.html file to work:
Hopefully this helps you - good luck!
Comment #7
gisleLooks like comments #6 provides enough information to resolve this, changing status.