#140 : Individual log files
This commit is contained in:
@ -3,7 +3,7 @@ import { TSocket } from '../utilities/types'
|
||||
import config from '../utilities/config'
|
||||
import UserRepository from '../repositories/userRepository'
|
||||
import { User } from '@prisma/client'
|
||||
import logger from '../utilities/logger'
|
||||
import { gameLogger } from '../utilities/logger'
|
||||
|
||||
/**
|
||||
* Socket io jwt auth middleware
|
||||
@ -12,7 +12,7 @@ import logger from '../utilities/logger'
|
||||
*/
|
||||
export async function Authentication(socket: TSocket, next: any) {
|
||||
if (!socket.request.headers.cookie) {
|
||||
logger.warn('No cookie provided')
|
||||
gameLogger.warn('No cookie provided')
|
||||
return next(new Error('Authentication error'))
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ export async function Authentication(socket: TSocket, next: any) {
|
||||
if (token) {
|
||||
verify(token, config.JWT_SECRET, async (err: any, decoded: any) => {
|
||||
if (err) {
|
||||
logger.error('Invalid token')
|
||||
gameLogger.error('Invalid token')
|
||||
return next(new Error('Authentication error'))
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ export async function Authentication(socket: TSocket, next: any) {
|
||||
next()
|
||||
})
|
||||
} else {
|
||||
logger.warn('No token provided')
|
||||
gameLogger.warn('No token provided')
|
||||
return next(new Error('Authentication error'))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user