Merge pull request #907 from sharelatex/sk-email-based-account-merge

Email based account merge
This commit is contained in:
Shane Kilkelly 2018-09-19 09:39:23 +01:00 committed by GitHub
commit 9852a916da
4 changed files with 19 additions and 6 deletions

View file

@ -44,7 +44,7 @@ module.exports = AuthenticationController =
return callback(err)
req.sessionStore.generate(req)
for key, value of oldSession
req.session[key] = value
req.session[key] = value unless key == '__tmp'
# copy to the old `session.user` location, for backward-comptability
req.session.user = req.session.passport.user
req.session.save (err) ->

View file

@ -40,6 +40,23 @@ The #{settings.appName} Team - #{settings.siteUrl}
templates = {}
templates.accountMergeToOverleafAddress = CTAEmailTemplate({
subject: () -> "Confirm Account Merge - #{settings.appName}"
title: () -> "Confirm Account Merge"
message: () ->
"""
To merge your ShareLaTeX and Overleaf accounts, click the button below.
If you think you have received this message in error,
please contact us at https://www.overleaf.com/contact
"""
ctaText: () -> "Confirm Account Merge"
ctaURL: (opts) -> opts.tokenLinkUrl
secondaryMessage: (opts) ->
"If the button does not appear, open this link in your browser: #{opts.tokenLinkUrl}"
})
templates.accountMergeToSharelatexAddress = templates.accountMergeToOverleafAddress
templates.registered = CTAEmailTemplate({
subject: () -> "Activate your #{settings.appName} Account"
message: (opts) -> """

View file

@ -68,6 +68,7 @@ module.exports = class Router
webRouter.get '/logout', UserController.logout
webRouter.get '/restricted', AuthorizationMiddlewear.restricted
if Features.hasFeature('registration')
webRouter.get '/register', UserPagesController.registerPage
AuthenticationController.addEndpointToLoginWhitelist '/register'

View file

@ -1,5 +0,0 @@
define [
"base"
], (App) ->
App.controller "AccountMergeCheckerController", ($scope) ->
$scope.hasOlAccount = null