mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
fix middlewares position
This commit is contained in:
parent
23ac71c95e
commit
98fee074d0
@ -159,10 +159,6 @@ class Server {
|
||||
req.jwtStrategy = this.options.jwtStrategy
|
||||
next()
|
||||
}
|
||||
this.httpInstance.middlewares["useWS"] = (req, res, next) => {
|
||||
req.ws = global.wsInterface
|
||||
next()
|
||||
}
|
||||
|
||||
passport.use(new LocalStrategy({
|
||||
usernameField: "username",
|
||||
@ -187,6 +183,11 @@ class Server {
|
||||
}
|
||||
|
||||
initWebsockets() {
|
||||
this.httpInstance.middlewares["useWS"] = (req, res, next) => {
|
||||
req.ws = global.wsInterface
|
||||
next()
|
||||
}
|
||||
|
||||
const onAuthenticated = (socket, user_id) => {
|
||||
this.attachClientSocket(socket, user_id)
|
||||
socket.emit("authenticated")
|
||||
|
Loading…
x
Reference in New Issue
Block a user