overleaf/services/web/app/coffee/Features/User/UserController.coffee

17 lines
459 B
CoffeeScript
Raw Normal View History

UserDeleter = require("./UserDeleter")
UserLocator = require("./UserLocator")
newsLetterManager = require('../Newsletter/NewsletterManager')
module.exports =
deleteUser: (req, res)->
user_id = req.session.user._id
UserDeleter.deleteUser user_id, (err)->
if !err?
req.session.destroy()
res.send(200)
unsubscribe: (req, res)->
UserLocator.findById req.session.user._id, (err, user)->
newsLetterManager.unsubscribe user, ->
res.send()