mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-24 08:22:15 +00:00
Guard against no apis.v1 setting
This commit is contained in:
parent
b1f378208d
commit
4deaf7865d
1 changed files with 3 additions and 1 deletions
|
@ -20,7 +20,7 @@ module.exports = V1SubscriptionManager =
|
||||||
return callback(null, null)
|
return callback(null, null)
|
||||||
V1SubscriptionManager._v1PlanRequest v1Id, (err, body) ->
|
V1SubscriptionManager._v1PlanRequest v1Id, (err, body) ->
|
||||||
return callback(err) if err?
|
return callback(err) if err?
|
||||||
planName = body.plan_name
|
planName = body?.plan_name
|
||||||
logger.log {userId, planName, body}, "[V1SubscriptionManager] fetched v1 plan for user"
|
logger.log {userId, planName, body}, "[V1SubscriptionManager] fetched v1 plan for user"
|
||||||
if planName in ['pro', 'pro_plus', 'student', 'free']
|
if planName in ['pro', 'pro_plus', 'student', 'free']
|
||||||
planName = "v1_#{planName}"
|
planName = "v1_#{planName}"
|
||||||
|
@ -30,6 +30,8 @@ module.exports = V1SubscriptionManager =
|
||||||
return callback(null, planName)
|
return callback(null, planName)
|
||||||
|
|
||||||
_v1PlanRequest: (v1Id, callback=(err, body)->) ->
|
_v1PlanRequest: (v1Id, callback=(err, body)->) ->
|
||||||
|
if !settings?.apis?.v1
|
||||||
|
return callback null, null
|
||||||
request {
|
request {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: settings.apis.v1.url +
|
url: settings.apis.v1.url +
|
||||||
|
|
Loading…
Reference in a new issue