Skip to content

Commit d14c68b

Browse files
author
Abdallah Elhadad
committed
revert: socket auth
1 parent 5987b1c commit d14c68b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/sockets/socket.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { authorize } from '@thream/socketio-jwt';
22
import { Server as HttpServer } from 'http';
33
import { Server } from 'socket.io';
44

5-
import { User } from '../api/user/userModel';
6-
import { userService } from '../api/user/userService';
75
import { env } from '../common/utils/envConfig';
86
import roomsEvents from './roomsEvents';
97
import {
@@ -29,11 +27,12 @@ export function connectSocket(server: HttpServer) {
2927
io.use(
3028
authorize({
3129
secret: env.JWT_SECRET,
32-
onAuthentication: async (user: User) => {
33-
const res = await userService.findById(user.id);
34-
if (!res) throw new Error('User not found');
35-
return res.responseObject;
36-
},
30+
//TODO: mmmm, need a trx??
31+
// onAuthentication: async (reqUser: User) => {
32+
// const user = await userService.getById(reqUser.id);
33+
// if (!user) throw new Error('User not found');
34+
// return user;
35+
// },
3736
})
3837
);
3938
}

0 commit comments

Comments
 (0)