mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
WIP: refactor
This commit is contained in:
parent
ab2c1e82fb
commit
eca4c46f7f
2 changed files with 5 additions and 5 deletions
|
@ -147,12 +147,12 @@ module.exports = (app, webRouter, apiRouter)->
|
||||||
webRouter.use (req, res, next)->
|
webRouter.use (req, res, next)->
|
||||||
res.locals.buildReferalUrl = (referal_medium) ->
|
res.locals.buildReferalUrl = (referal_medium) ->
|
||||||
url = Settings.siteUrl
|
url = Settings.siteUrl
|
||||||
if req.session? and req.session.user? and req.session.user.referal_id?
|
if req.user? and req.referal_id?
|
||||||
url+="?r=#{req.session.user.referal_id}&rm=#{referal_medium}&rs=b" # Referal source = bonus
|
url+="?r=#{req.user.referal_id}&rm=#{referal_medium}&rs=b" # Referal source = bonus
|
||||||
return url
|
return url
|
||||||
res.locals.getReferalId = ->
|
res.locals.getReferalId = ->
|
||||||
if req.session? and req.session.user? and req.session.user.referal_id
|
if req.user? and req.referal_id?
|
||||||
return req.session.user.referal_id
|
return req.user.referal_id
|
||||||
res.locals.getReferalTagLine = ->
|
res.locals.getReferalTagLine = ->
|
||||||
tagLines = [
|
tagLines = [
|
||||||
"Roar!"
|
"Roar!"
|
||||||
|
|
|
@ -119,7 +119,7 @@ apiRouter.use(currentUserMiddleware)
|
||||||
webRouter.use (req, res, next) ->
|
webRouter.use (req, res, next) ->
|
||||||
req.session.touch()
|
req.session.touch()
|
||||||
if req?.session?.user?
|
if req?.session?.user?
|
||||||
UserSessionsManager.touch(req.session.user, (err)->)
|
UserSessionsManager.touch(req.user, (err)->)
|
||||||
next()
|
next()
|
||||||
|
|
||||||
webRouter.use ReferalConnect.use
|
webRouter.use ReferalConnect.use
|
||||||
|
|
Loading…
Reference in a new issue