Giter Site home page Giter Site logo

Comments (3)

signalpoint avatar signalpoint commented on August 19, 2024

@jsheffers Yes, this does sound like a CORS issue. Since the login result is successful, and this is in turn feeds into the jDrupal.connect() (as you noticed, which makes a call off to Drupal requesting new session info) and then the connect mechanism reports it as anonymous. This definitely sounds like a CORS issue then. I personally haven't ran into this issue, but there has been a lot of chatter about CORS in jDrupal's issue queue, as well as DrupalGap's issue queue(s), and I think the solution that folks have arrived at will work in both D7 and D8.

from angular-drupal.

jsheffers avatar jsheffers commented on August 19, 2024

I changed this so that they are on the same domain, and the cookie still won't persist. I have the URL's set up like this:

Angular: example.com:3000
Drupal: example.com

When I call the login function this is the full network tab below. I've blocked out the domain name for privacy purposes.

Call 1:
response1

Call 2:
response2

As you can see here the SET cookie value is working

Call 3:
response3

Any other ideas? I'd love to use this, but I need user authentication to be working. You can also see the withCredentials header in each of the requests, so I don't think that's the issue. Could it be a Drupal 8.3.3 issue?

from angular-drupal.

jsheffers avatar jsheffers commented on August 19, 2024

Ended up adding the following JS to the top of my index.html page.

    <script>
      window.XMLHttpRequest_ = XMLHttpRequest;
      XMLHttpRequest = function(){
       var xhr = new window.XMLHttpRequest_;
       xhr.withCredentials = true;
       return xhr;
      }
    </script>

from angular-drupal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.