Giter VIP home page Giter VIP logo

Comments (6)

Mordred avatar Mordred commented on July 4, 2024

Can you post plugins setup? I think you have added a CSRFInterceptor and didn't enable CSRF protection in the Sails config.

CSRFInterceptor will fetch CSRF token before sending non-GET request.

If you don't want to have CSRF protection, remove this interceptor from setup.

from aurelia-sails-socket-client.

rahulravindran0108 avatar rahulravindran0108 commented on July 4, 2024

The following is my code for configuration

  aurelia.use.plugin('aurelia-sails-socket-client', (sails, io) => {
    sails.configure(x => {
      //console.log(x);
      //console.log(io);
      let config = new Config();
      if(config.debugMode)
        io.sails.url = config.debugSailsUrl;
      x.withBaseUrl(config.debugSailsUrl);
      // Example for CSRFInterceptor
      x.withInterceptor(new CSRFInterceptor('/csrfToken', sails));
      x.withInterceptor(new LoggerInterceptor());
    });

  });

Also, in your readme, you have mentioned x.withBaseUri which is no longer present. My code seems to configuring the client properly and also connects well. I have been using socket.request to make get/put/post requests for now.

from aurelia-sails-socket-client.

Mordred avatar Mordred commented on July 4, 2024

Thanks - I have fixed README typo x.withBaseUri.

Another issue was this.sails.get(.....) was doing a post request for some reason.I kind of felt this behaviour odd!

Can you be more specific?

from aurelia-sails-socket-client.

rahulravindran0108 avatar rahulravindran0108 commented on July 4, 2024

Sorry for the last part of the comment. Edited it out!

from aurelia-sails-socket-client.

Mordred avatar Mordred commented on July 4, 2024

OK, so is this issue fixed?

from aurelia-sails-socket-client.

rahulravindran0108 avatar rahulravindran0108 commented on July 4, 2024

Yes, its working now. Closing it. Thank you very much for solving.

from aurelia-sails-socket-client.

Related Issues (11)

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.