mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Moved session verified check behind staff2fa flag
This commit is contained in:
parent
cb8d18423a
commit
3cffb9a132
1 changed files with 7 additions and 2 deletions
|
@ -42,8 +42,13 @@ function SessionMiddleware({sessionService}) {
|
|||
async function authenticate(req, res, next) {
|
||||
try {
|
||||
const user = await sessionService.getUserForSession(req, res);
|
||||
const isVerified = await sessionService.isVerifiedSession(req, res);
|
||||
if (user && isVerified) {
|
||||
if (user) {
|
||||
if (labs.isSet('staff2fa')) {
|
||||
const isVerified = await sessionService.isVerifiedSession(req, res);
|
||||
if (!isVerified) {
|
||||
return next();
|
||||
}
|
||||
}
|
||||
// Do not nullify `req.user` as it might have been already set
|
||||
// in a previous middleware (authorize middleware).
|
||||
req.user = user;
|
||||
|
|
Loading…
Reference in a new issue