trying another fix for login
This commit is contained in:
parent
9cf80552e3
commit
d0c6705c0b
2 changed files with 1 additions and 4 deletions
|
@ -25,9 +25,6 @@ app.use(
|
||||||
secret: secret.session,
|
secret: secret.session,
|
||||||
resave: true,
|
resave: true,
|
||||||
saveUninitialized: false,
|
saveUninitialized: false,
|
||||||
cookie: {
|
|
||||||
httpOnly: false,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
app.use(passport.initialize())
|
app.use(passport.initialize())
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { Express, Request, Response, NextFunction } from "express"
|
||||||
import config from "../config.json"
|
import config from "../config.json"
|
||||||
|
|
||||||
const checkIfLoggedIn = (req: Request, res: Response, next: NextFunction) => {
|
const checkIfLoggedIn = (req: Request, res: Response, next: NextFunction) => {
|
||||||
if (req.isAuthenticated() && req.user) return next()
|
if (req.isAuthenticated()) return next()
|
||||||
res.status(401).send()
|
res.status(401).send()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue