Closed caracal7 closed 4 years ago
Deepstream 5.0.12
const { DeepstreamPlugin } = require('@deepstream/types'); module.exports = class Permission extends DeepstreamPlugin { constructor ( pluginOptions, services) { super( pluginOptions, services); } async canPerformAction (socketWrapper, message, callback, passItOn) { console.log('canPerformAction', socketWrapper.userId, socketWrapper.isRemote, socketWrapper.serverData, // <---------- Empty socketWrapper.clientData, // <---------- Empty message.topic, message.action ); return callback(socketWrapper, message, passItOn, null, true); } async whenReady () {} close () {} }
authentication
const isValidUser = async ( handshakeData, authData ) => { ///........ return { isValid: true, id: username, clientData: { msgFromAuthServer: `I am ${username} and i logged in` }, serverData: { group }, } }
That should work. Can you specific your server version?
Sorry. Its seems like my mistake. I don't know what I did but everything works as expected
Deepstream 5.0.12
authentication