mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
11 lines
325 B
CoffeeScript
11 lines
325 B
CoffeeScript
User = require("../../models/User").User
|
|
|
|
module.exports = RefererMiddleware =
|
|
getUserReferalId: (req, res, next) ->
|
|
if req.session? and req.session.user?
|
|
User.findById req.session.user._id, (error, user) ->
|
|
return next(error) if error?
|
|
req.session.user.referal_id = user.referal_id
|
|
next()
|
|
else
|
|
next()
|