@ -89,9 +89,9 @@ async function onConnect(socket) {
} catch ( e ) {
} catch ( e ) {
if ( e . message === '[[error:invalid-session]]' ) {
if ( e . message === '[[error:invalid-session]]' ) {
socket . emit ( 'event:invalid_session' ) ;
socket . emit ( 'event:invalid_session' ) ;
return ;
}
}
throw e ;
return ;
}
}
if ( socket . uid ) {
if ( socket . uid ) {
@ -208,12 +208,12 @@ async function validateSession(socket, errorMsg) {
if ( ! sessionData ) {
if ( ! sessionData ) {
throw new Error ( errorMsg ) ;
throw new Error ( errorMsg ) ;
}
}
const result = await plugins . hooks . fire ( 'static:sockets.validateSession' , {
await plugins . hooks . fire ( 'static:sockets.validateSession' , {
req : req ,
req : req ,
socket : socket ,
socket : socket ,
session : sessionData ,
session : sessionData ,
} ) ;
} ) ;
return result ;
}
}
const cookieParserAsync = util . promisify ( ( req , callback ) => cookieParser ( req , { } , err => callback ( err ) ) ) ;
const cookieParserAsync = util . promisify ( ( req , callback ) => cookieParser ( req , { } , err => callback ( err ) ) ) ;