import FetchResult from '../common/web/fetchResult.js' import { HTTP_STATUS } from '../common/constant/httpStatus.js' export async function authenticateSession(req, res, next) { if (req.session.user) { next() } else { return FetchResult.formatResult(res, HTTP_STATUS.UNAUTHORIZED, 'Unauthorized') } }