mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Upgrade server dependencies
This commit is contained in:
parent
f55cc0f97a
commit
fbd51e69f2
5 changed files with 1278 additions and 731 deletions
|
@ -32,6 +32,7 @@ function authenticateSocket (socket: Socket, next: (err?: any) => void) {
|
|||
logger.debug('Checking socket access token %s.', accessToken)
|
||||
|
||||
if (!accessToken) return next(new Error('No access token provided'))
|
||||
if (typeof accessToken !== 'string') return next(new Error('Access token is invalid'))
|
||||
|
||||
getAccessToken(accessToken)
|
||||
.then(tokenDB => {
|
||||
|
@ -41,7 +42,7 @@ function authenticateSocket (socket: Socket, next: (err?: any) => void) {
|
|||
return next(new Error('Invalid access token.'))
|
||||
}
|
||||
|
||||
socket.handshake.query['user'] = tokenDB.User
|
||||
socket.handshake.auth.user = tokenDB.User
|
||||
|
||||
return next()
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue