-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Login issue with different token and sessid #37
Comments
@Saneesh what URL does your app live at? What URL does your Drupal site live at? Are they in the same domain? It sounds like you're having a cross domain issue, where the domain that Drupal wants to store the cookie is different than the domain of your app, so the cookie from Drupal doesn't get written properly to the app, and the app's user always appears to be logged out. |
Hello Tyler, From this URL I'm accessing the Drupal instance in different server. To make it work, what are the settings I need to change in Drupal instance? Thanks, |
@Saneesh You don't need to worry about the X-CSRF-Token, once it's retrieved, angular-drupal will properly use it with each of its Service commands. The user login function in angular-drupal just needs to be modified to set aside the token, instead of asking for the new token, then setting it aside: https://github.com/easystreet3/angular-drupal/blob/7.x-1.x/src/angular-drupal.js#L99 Other than that, you need to set up CORS policies (something I am not familiar with) to allow your application to connect to a different domain. |
Hello Tyler, if I understand well your reply there are two points. 1) "The user login function in angular-drupal just needs to be modified to set aside the token". 2) Check CORS in Drupal. But still I'm facing the same issue. |
Is there anything I need to set in AngularJS side? |
I don't know much further than this, many others have this "issue", and I don't know where entirely the solution lies, but others have gotten around this and it mostly has to do with configuration on a per project basis. Check out the following issue queues and you'll find many discussions about this related issue, and you'll hear from others who have identified the ways they've gotten around this situation:
Although the projects are different, the problem(s) seems to be one in the same. |
@Saneesh If you’re running into CORS problems with just with dev on local, use Chrome with web security disabled or use the CORS plugin to disable it. |
Hello,
I'm trying to build a mobile app using angular-drupal. After configure everything, when I call the user_login() in my controller, it shows 'NOT A VALID USER!' message.
In Firefox console, I can see three calls as follows (user/login.json, session/token and connect.json )
When it gets the token it returns a new token.
When it calls 'connect', session_name is same but the sessid is different.
Might be because of this reason, I'm not getting user login success message.
I'm using Drupal 7 as backend. Instead of 'drupalgap' service endpoint I tried with a service called 'api' as mentioned in the tutorial(https://www.npmjs.com/package/angular-drupal) but still shows 'NOT A VALID USER!' message.
How can I fix this issue?
The text was updated successfully, but these errors were encountered: