Merge pull request #4338 from overleaf/ab-session-manager
Extract functions from AuthenticationController to SessionManager GitOrigin-RevId: 86870ce03a762e1a837dcf493759e8851e759883
This commit is contained in:
committed by
Copybot
parent
7e61fc4035
commit
9468e5cb4f
@@ -1,10 +1,10 @@
|
||||
const NotificationsHandler = require('./NotificationsHandler')
|
||||
const AuthenticationController = require('../Authentication/AuthenticationController')
|
||||
const SessionManager = require('../Authentication/SessionManager')
|
||||
const _ = require('underscore')
|
||||
|
||||
module.exports = {
|
||||
getAllUnreadNotifications(req, res) {
|
||||
const userId = AuthenticationController.getLoggedInUserId(req)
|
||||
const userId = SessionManager.getLoggedInUserId(req.session)
|
||||
NotificationsHandler.getUserNotifications(
|
||||
userId,
|
||||
function (err, unreadNotifications) {
|
||||
@@ -24,7 +24,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
markNotificationAsRead(req, res) {
|
||||
const userId = AuthenticationController.getLoggedInUserId(req)
|
||||
const userId = SessionManager.getLoggedInUserId(req.session)
|
||||
const { notificationId } = req.params
|
||||
NotificationsHandler.markAsRead(userId, notificationId, () =>
|
||||
res.sendStatus(200)
|
||||
|
||||
Reference in New Issue
Block a user