-
-
Notifications
You must be signed in to change notification settings - Fork 751
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
Explicit authentication for emitting messages but not for listening #567
Comments
If you This is exactly the same call that the client service using |
@daffl I agree. As you said I am getting Not Authenticated error. But the issue I want to point out is that why we can receive messages without authenticating the socket? |
Because you need to filter messages on the server. There are so many different types of auth implementations that it's kinda impossible to provide a basic setup out of the box. |
@marshallswain thanks for pointing that out. Then this behavior is as per implementation. |
As @marshallswain pointed out, you have to explicitly add event filtering. We are working on improving this (see #388 (comment)) but for now this is indeed how it is intended. Going to close this issue. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs. |
Steps to reproduce
REST API works with one time authentication. But socket needs authentication everytime
import socketio from 'feathers-socketio/client';
this.app = feathers()
.configure(socketio(socket))
.configure(hooks())
.configure(authentication({
storage: AsyncStorage // To store our accessToken
}));
app.io.emit('messages::create', {
"text": "I really have to iron"
}, (error, message) => {
console.log('Todo created', message);
});
emit results in no output as socket is not explicitly authenticated
Expected behavior
we can listen to server message without explicit authentication. shouldn't the behaviour be same for both emitting and listening to messages
Actual behavior
console.: Todo created undefined
React Native Version:0.43.4
The text was updated successfully, but these errors were encountered: