mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-08 19:50:47 +00:00
Add debug query string origin
to invocations of the updateSubscription endpoint.
This commit is contained in:
parent
a904427531
commit
03aa9b87f1
3 changed files with 5 additions and 5 deletions
|
@ -167,12 +167,13 @@ module.exports = SubscriptionController =
|
|||
res.redirect "/user/subscription"
|
||||
|
||||
updateSubscription: (req, res, next)->
|
||||
_origin = req?.query?.origin || null
|
||||
AuthenticationController.getLoggedInUser req, (error, user) ->
|
||||
return next(error) if error?
|
||||
planCode = req.body.plan_code
|
||||
if !planCode?
|
||||
err = new Error('plan_code is not defined')
|
||||
logger.err {user_id: user._id, err, planCode}, "[Subscription] error in updateSubscription form"
|
||||
logger.err {user_id: user._id, err, planCode, origin: _origin, body: req.body}, "[Subscription] error in updateSubscription form"
|
||||
return next(err)
|
||||
logger.log planCode: planCode, user_id:user._id, "updating subscription"
|
||||
SubscriptionHandler.updateSubscription user, planCode, null, (err)->
|
||||
|
|
|
@ -19,7 +19,7 @@ block content
|
|||
Recurly.config(!{recurlyConfig})
|
||||
Recurly.buildBillingInfoUpdateForm({
|
||||
target : "#billingDetailsForm",
|
||||
successURL : "#{successURL}?_csrf=#{csrfToken}",
|
||||
successURL : "#{successURL}?_csrf=#{csrfToken}&origin=editBillingDetails",
|
||||
signature : "!{signature}",
|
||||
accountCode : "#{user.id}"
|
||||
});
|
||||
|
|
|
@ -62,8 +62,7 @@ define [
|
|||
|
||||
$scope.inflight = true
|
||||
|
||||
|
||||
$http.post(SUBSCRIPTION_URL, body)
|
||||
$http.post("#{SUBSCRIPTION_URL}?origin=confirmChangePlan", body)
|
||||
.success ->
|
||||
location.reload()
|
||||
.error ->
|
||||
|
@ -124,7 +123,7 @@ define [
|
|||
plan_code: 'student'
|
||||
_csrf : window.csrfToken
|
||||
$scope.inflight = true
|
||||
$http.post(SUBSCRIPTION_URL, body)
|
||||
$http.post("#{SUBSCRIPTION_URL}?origin=downgradeToStudent", body)
|
||||
.success ->
|
||||
location.reload()
|
||||
.error ->
|
||||
|
|
Loading…
Add table
Reference in a new issue