Comments (6)
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.
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.
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.
Sorry for the last part of the comment. Edited it out!
from aurelia-sails-socket-client.
OK, so is this issue fixed?
from aurelia-sails-socket-client.
Yes, its working now. Closing it. Thank you very much for solving.
from aurelia-sails-socket-client.
Related Issues (11)
- Setup? HOT 2
- Example app runs, but contains no content HOT 1
- Request
- Sails installation HOT 1
- Running example app HOT 3
- Socket HOT 3
- Cannot lift example in production mode HOT 3
- Separate backend/frontend HOT 1
- Connections outside an isomorphic sails app doesn't seem to work. HOT 5
- disabled autoconnect HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aurelia-sails-socket-client.