mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
31 lines
887 B
CoffeeScript
31 lines
887 B
CoffeeScript
|
logger = require("logger-sharelatex")
|
||
|
TeamInvitesHandler = require('./TeamInvitesHandler')
|
||
|
AuthenticationController = require("../Authentication/AuthenticationController")
|
||
|
|
||
|
module.exports =
|
||
|
createInvite: (req, res, next) ->
|
||
|
adminUserId = AuthenticationController.getLoggedInUserId(req)
|
||
|
email = req.body.email
|
||
|
|
||
|
TeamInvitesHandler.createInvite adminUserId, email, (err, invite) ->
|
||
|
next(err) if err?
|
||
|
inviteView = { user:
|
||
|
{ email: invite.email, sentAt: invite.sentAt, holdingAccount: true }
|
||
|
}
|
||
|
res.json inviteView
|
||
|
|
||
|
viewInvite: (req, res) ->
|
||
|
token = request.params.token
|
||
|
|
||
|
TeamInvitesHandler.getInvite token, (err, invite) ->
|
||
|
next(err) if err?
|
||
|
|
||
|
res.render "referal/bonus",
|
||
|
title: "bonus_please_recommend_us"
|
||
|
refered_users: refered_users
|
||
|
refered_user_count: (refered_users or []).length
|
||
|
|
||
|
acceptInvite: (req, res) ->
|
||
|
|
||
|
revokeInvite: (req, res) ->
|