mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
notifications route; added middleware.authenticate to user/uploadpicture api route
This commit is contained in:
@@ -372,10 +372,6 @@ accountsController.accountSettings = function(req, res, next) {
|
||||
};
|
||||
|
||||
accountsController.uploadPicture = function (req, res, next) {
|
||||
if (!req.user) {
|
||||
return userNotAllowed();
|
||||
}
|
||||
|
||||
var uploadSize = parseInt(meta.config.maximumProfileImageSize, 10) || 256;
|
||||
if (req.files.userPhoto.size > uploadSize * 1024) {
|
||||
return res.json({
|
||||
@@ -473,4 +469,18 @@ accountsController.uploadPicture = function (req, res, next) {
|
||||
});
|
||||
};
|
||||
|
||||
accountsController.getNotifications = function(req, res, next) {
|
||||
user.notifications.getAll(req.user.uid, null, null, function(err, notifications) {
|
||||
if (res.locals.isAPI) {
|
||||
res.json({
|
||||
notifications: notifications
|
||||
});
|
||||
} else {
|
||||
res.render('notifications', {
|
||||
notifications: notifications
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = accountsController;
|
||||
Reference in New Issue
Block a user