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
What i am trying to do now is closing the connection over this App so it can be allowed through specific authenticated users. I want to enquire how can i integrate the JWT authentication as part of the socket app life cycle.
Hey @raymondfeng, yeah i've noticed that you're using websocket.controller.ts for exposing the socket connections. However, i want to enquire if its possible to following coding strategy in the following reference, where i can just append the (authenticate) decorator as the following:
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.
Activity
dougal83 commentedon Jan 15, 2020
Hey @baltameme
You might want to pose your question on https://stackoverflow.com/ with tags loopback and websocket.
raymondfeng commentedon Jan 15, 2020
@baltameme I wonder if you have the JWT token validation up
connect. See https://github.com/raymondfeng/loopback4-example-websocket/blob/master/src/controllers/websocket.controller.ts#L18baltameme commentedon Jan 16, 2020
Hey @raymondfeng, yeah i've noticed that you're using websocket.controller.ts for exposing the socket connections. However, i want to enquire if its possible to following coding strategy in the following reference, where i can just append the (authenticate) decorator as the following:
@ws.connect()
@authenticate('jwt')
connect(socket: Socket) {
console.log('Client connected: %s', this.socket.id);
socket.join('room 1');
}
stale commentedon Dec 25, 2020
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the
CODEOWNERSfile at the top-level of this repository. This issue will be closed within 30 days of being stale.