How do I update query/auth on connect? #3902
Answered
by
darrachequesne
FerusAndBeyond
asked this question in
Q&A
-
How can query/auth be updated during reconnect() or connect() to a new namespace? Whenever I try to do this the initially set auth/query is kept:
If I set token to |
Beta Was this translation helpful? Give feedback.
Answered by
darrachequesne
May 3, 2021
Replies: 1 comment 4 replies
-
You can update those options in the "reconnect_attempt" event: socket.io.on("reconnect_attempt", () => {
socket.io.opts.query.token = 123;
socket.auth.token = 456;
}); Please note that the Reference: |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
FerusAndBeyond
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can update those options in the "reconnect_attempt" event:
Please note that the
query
option will be shared between the Socket instances of the same connection.Reference: