Skip to content
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

Authentication over socket.io never answers #428

Closed
PierBover opened this Issue Mar 1, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@PierBover
Copy link

PierBover commented Mar 1, 2017

When using rest everything works fine, but when doing authenticate(...) from the client using socket.io the promise never resolves or rejects.

We can see in the logs that the requests are indeed reaching the server at /socket.io/?EIO=3&transport=websocket&sid=4dYbvCOb3Bkrw_mWAABM and queries are being done on the DB... but in the client nothing happens.

This is how we configure feathers client:

const socket = io('https://XXXX.com');

const client = Feathers()
.configure(hooks())
.configure(socketio(socket))
.configure(FeathersAuth({
	storage: localStorage,
	path: '/auth/local'
}));

socket.io.engine.on('upgrade', function(transport) {
	console.log('transport changed');
	client.authenticate();
});

Then:

const options = {
	strategy: 'local',
	username,
	password
};

FeathersClient.authenticate(options).then((response) => {
	console.log("Authenticated!");
}).catch((error) => {
	console.log("Authentication error", error);
});

Any idea what might be happening?

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Mar 1, 2017

Please send the versions of the server and client packages you are using (npm ls feathers-authentication).

@PierBover

This comment has been minimized.

Copy link
Author

PierBover commented Mar 1, 2017

We are using 0.1.9 in the client and 0.7.12 in the server.

@PierBover

This comment has been minimized.

Copy link
Author

PierBover commented Mar 1, 2017

@daffl pointed out via Slack that I need to use feathers-authentication@0.7.x/client and not feathers-authentication-client

@PierBover PierBover closed this Mar 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.