Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Conversation

@dkadiog
Copy link

@dkadiog dkadiog commented Mar 23, 2023

What changes this PR introduce?

If a middleware sets the token for the request, its not present in the handshake and therefore not authorized. This supports also a auth header.

List any relevant issue numbers

Is there anything you'd like reviewers to focus on?

If a middleware sets the token for the request, its not present in the handshake and therefore not authorized. This supports also a auth header.
const { secret, algorithms = ['HS256'], onAuthentication } = options
return async (socket, next) => {
let encodedToken: string | null = null
const { token } = socket.handshake.auth
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const { token } = socket.handshake.auth
let { token } = socket.handshake.auth

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants