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
I did set jwt expire time very shortly for testing token refreshing. set 5seconds.
config/default.json
after 5seconds.
feathers debug printed "Removing authentication information and expiration timer from connection"
and then socket connection was disconnected.
Normally socket.IO would try to reconnect, but no reconnection attempt was made.
The reason seems to be a normal disconnection from the server.
so when I do service('users').find (), It freezes. (because socket is disconnected)
Expected behavior
Even if the jwt expire time expires,
I expected the socket connection to remain connected and
only the authentication information to be deleted.
Actual behavior
at @feathersjs/authentication/src/jwt.ts@52
It will fire app.emit('dissconect) when jwt expire time.
at @feathersjs/authentication/src/jwt.ts@64
I will remove auth info in socket connection when app.on('disconnect')
@feathersjs/socketio/src/middleware@7
when app.on('disconnect') -> socket.disconnect()
app.emit('disconnect') is executed, the socket is actually disconnected.
I don't know if disconnecting when the jwt expires is the intended design.
I changed it to app.emit('auth-expired') instead of app.emit('disconnect'),
and changed the event name in the jwt to the corresponding event name, and it worked as I expected.
Module versions (especially the part that's not working):
5.0.25
The text was updated successfully, but these errors were encountered:
fxpoet
changed the title
socket disconnected when jwt expired.
Socket disconnected when jwt expired.
Jun 28, 2024
fxpoet
changed the title
Socket disconnected when jwt expired.
Socket connection is disconnected when jwt expired.
Jun 28, 2024
In the case of socket connections, there are also anonymous connections that are not related to authentication. Therefore, when the jwt expires, the connection should remain intact and only the authentication information should be deleted to return to an anonymous state. However, the current implementation disconnects the connection and does not attempt to reconnect, so it causes a freeze when .find() is performed.
Steps to reproduce
I did set jwt expire time very shortly for testing token refreshing. set 5seconds.
config/default.json
after 5seconds.
feathers debug printed "Removing authentication information and expiration timer from connection"
and then socket connection was disconnected.
Normally socket.IO would try to reconnect, but no reconnection attempt was made.
The reason seems to be a normal disconnection from the server.
so when I do service('users').find (), It freezes. (because socket is disconnected)
Expected behavior
Even if the jwt expire time expires,
I expected the socket connection to remain connected and
only the authentication information to be deleted.
Actual behavior
at @feathersjs/authentication/src/jwt.ts@52
It will fire app.emit('dissconect) when jwt expire time.
at @feathersjs/authentication/src/jwt.ts@64
I will remove auth info in socket connection when app.on('disconnect')
@feathersjs/socketio/src/middleware@7
when app.on('disconnect') -> socket.disconnect()
app.emit('disconnect') is executed, the socket is actually disconnected.
I don't know if disconnecting when the jwt expires is the intended design.
I changed it to app.emit('auth-expired') instead of app.emit('disconnect'),
and changed the event name in the jwt to the corresponding event name, and it worked as I expected.
Module versions (especially the part that's not working):
5.0.25
The text was updated successfully, but these errors were encountered: