mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-03 06:32:45 +00:00
WIP: add email-based account merge flow to ShareLaTeX
This commit is contained in:
parent
b16cffe587
commit
ba221a1135
2 changed files with 37 additions and 1 deletions
|
@ -40,6 +40,14 @@ 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 link below."
|
||||
ctaText: () -> "Confirm Account Merge"
|
||||
ctaURL: (opts) -> opts.tokenLinkUrl
|
||||
})
|
||||
|
||||
templates.registered = CTAEmailTemplate({
|
||||
subject: () -> "Activate your #{settings.appName} Account"
|
||||
message: (opts) -> """
|
||||
|
|
|
@ -1,5 +1,33 @@
|
|||
define [
|
||||
"base"
|
||||
], (App) ->
|
||||
App.controller "AccountMergeCheckerController", ($scope) ->
|
||||
|
||||
# For account-merge-module
|
||||
App.controller "SharelatexAccountMergeCheckerController", ($scope, $http) ->
|
||||
$scope.hasOlAccount = null
|
||||
$scope.olEmail = ""
|
||||
$scope.errorCode = null
|
||||
$scope.success = null
|
||||
console.log ">>>> here"
|
||||
|
||||
$scope.submitEmail = () ->
|
||||
return if !$scope.olEmail
|
||||
data = {
|
||||
overleafEmail: $scope.olEmail
|
||||
_csrf: window.csrfToken
|
||||
}
|
||||
console.log ">>>> sending email", data
|
||||
$scope.errorCode = null
|
||||
$http.post("/account-merge/email/overleaf", data)
|
||||
.then (resp) ->
|
||||
console.log ">>>> success", resp
|
||||
$scope.errorCode = null
|
||||
$scope.success = true
|
||||
.catch (resp) ->
|
||||
console.log ">>>> error", resp
|
||||
$scope.errorCode = resp?.data?.errorCode || 'default_error'
|
||||
$scope.success = false
|
||||
|
||||
# For integration-module
|
||||
App.controller "OverleafAccountMergeCheckerController", ($scope) ->
|
||||
$scope.hasOlAccount = null
|
||||
|
|
Loading…
Reference in a new issue