1
0
Fork 0
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:
Chocobozzz 2021-03-03 15:22:38 +01:00
parent f55cc0f97a
commit fbd51e69f2
No known key found for this signature in database
GPG key ID: 583A612D890159BE
5 changed files with 1278 additions and 731 deletions

View file

@ -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()
})