This commit is contained in:
2025-02-07 20:07:36 +01:00
parent 37f2cd90e6
commit fae428f239
10 changed files with 38 additions and 43 deletions

View File

@ -1,4 +1,4 @@
import { verify } from 'jsonwebtoken'
import jwt from 'jsonwebtoken'
import config from '#application/config'
import Logger, { LoggerType } from '#application/logger'
@ -39,7 +39,7 @@ class SocketAuthenticator {
}
private verifyToken(token: string): void {
verify(token, config.JWT_SECRET, (err: any, decoded: any) => {
jwt.verify(token, config.JWT_SECRET, (err: any, decoded: any) => {
if (err) {
this.logger.error('Invalid token')
return this.next(new Error('Authentication error'))