Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
REST auth/local not working if socketio() not set #72
I encountered the following issue while trying to work with multiple feathers instances :
The following configuration throws an error if I try to POST to /auth/local with username and password :
If I uncomment the following line to use socketio it works :
I think the app variable is not available in
So the explanation is actually fairly simple. Usually when using it as a sub-app you have to call
When mounted as a sub-app with websockets configured however, they will override their parent setup (see https://github.com/feathersjs/feathers-socket-commons/blob/master/src/index.js#L59) so that you don't have to do that.
This should probably be the expected behaviour of core in general but it might be tricky to change without breaking things (if we add it to core and you have an older websocket library it'll call
Your case can be fixed like this:
var feathersapp = feathers().use('/api/v1/rest', app); var server = feathersapp.listen(); app.setup(server);
referenced this issue
Feb 23, 2016
Documentation has been added via feathersjs/docs@b25787e and can be found in the Middleware -> SSL, Virtual Hosts and sub-apps chapter.