You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// server/models/my-user.js// ...constloopbackSocket=LoopbackSocket.get('myapp');loopbackSocket.auth({model: MyUser,method: 'authenticate',});MyUser.authenticate=function(socket,credentials){returnPromise.resolve().then(()=>{if(!credentials)throw'Socket Credentials not recieved';returnapp.models.AccessToken.findOne({where: {userId: credentials.userId,id: credentials.id}});}).then((token)=>{if(!token)throw'Socket Token not found';returnMyUser.findById(token.userId);}).then((user)=>{if(!user)throw'Socket User not found';})};// ...