Merge pull request #4338 from overleaf/ab-session-manager

Extract functions from AuthenticationController to SessionManager

GitOrigin-RevId: 86870ce03a762e1a837dcf493759e8851e759883
This commit is contained in:
Alexandre Bourdin
2021-07-28 12:36:22 +00:00
committed by Copybot
parent 7e61fc4035
commit 9468e5cb4f
66 changed files with 460 additions and 458 deletions
@@ -1,11 +1,11 @@
let UserController
const UserGetter = require('./UserGetter')
const AuthenticationController = require('../Authentication/AuthenticationController')
const SessionManager = require('../Authentication/SessionManager')
const { ObjectId } = require('mongodb')
module.exports = UserController = {
getLoggedInUsersPersonalInfo(req, res, next) {
const userId = AuthenticationController.getLoggedInUserId(req)
const userId = SessionManager.getLoggedInUserId(req.session)
if (!userId) {
return next(new Error('User is not logged in'))
}