mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Fix flags protecting getV1DocPublishedInfo access (#2395)
GitOrigin-RevId: 9122d06cae52ff0b949a2904e485aa70ca3de896
This commit is contained in:
parent
9bfe58a959
commit
0866b9de9b
2 changed files with 3 additions and 2 deletions
|
@ -255,7 +255,7 @@ const TokenAccessHandler = {
|
|||
|
||||
getV1DocPublishedInfo(token, callback) {
|
||||
// default to allowing access
|
||||
if (!Settings.apis || !Settings.apis.v1) {
|
||||
if (!Settings.apis.v1 || !Settings.apis.v1.url) {
|
||||
return callback(null, { allow: true })
|
||||
}
|
||||
V1Api.request(
|
||||
|
|
|
@ -925,6 +925,7 @@ describe('TokenAccessHandler', function() {
|
|||
|
||||
describe('when v1 api not set', function() {
|
||||
beforeEach(function() {
|
||||
this.settings.apis = { v1: undefined }
|
||||
return this.TokenAccessHandler.getV1DocPublishedInfo(
|
||||
this.token,
|
||||
this.callback
|
||||
|
@ -943,7 +944,7 @@ describe('TokenAccessHandler', function() {
|
|||
|
||||
describe('when v1 api is set', function() {
|
||||
beforeEach(function() {
|
||||
return (this.settings.apis = { v1: 'v1' })
|
||||
return (this.settings.apis = { v1: { url: 'v1Url' } })
|
||||
})
|
||||
|
||||
describe('on V1Api.request success', function() {
|
||||
|
|
Loading…
Reference in a new issue