mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +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
|
req.jwtStrategy = this.options.jwtStrategy
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
this.httpInstance.middlewares["useWS"] = (req, res, next) => {
|
|
||||||
req.ws = global.wsInterface
|
|
||||||
next()
|
|
||||||
}
|
|
||||||
|
|
||||||
passport.use(new LocalStrategy({
|
passport.use(new LocalStrategy({
|
||||||
usernameField: "username",
|
usernameField: "username",
|
||||||
@ -187,6 +183,11 @@ class Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initWebsockets() {
|
initWebsockets() {
|
||||||
|
this.httpInstance.middlewares["useWS"] = (req, res, next) => {
|
||||||
|
req.ws = global.wsInterface
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
|
||||||
const onAuthenticated = (socket, user_id) => {
|
const onAuthenticated = (socket, user_id) => {
|
||||||
this.attachClientSocket(socket, user_id)
|
this.attachClientSocket(socket, user_id)
|
||||||
socket.emit("authenticated")
|
socket.emit("authenticated")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user