mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Send web requests with HTTP auth
This commit is contained in:
parent
66dfafdebe
commit
ce587a00ba
3 changed files with 12 additions and 0 deletions
|
@ -9,6 +9,10 @@ module.exports = WebApiManager =
|
|||
request.post {
|
||||
url: url
|
||||
qs: {user_id}
|
||||
auth:
|
||||
user: settings.apis.web.user
|
||||
pass: settings.apis.web.pass
|
||||
sendImmediately: true
|
||||
json: true
|
||||
jar: false
|
||||
}, (error, response, data) ->
|
||||
|
|
|
@ -13,6 +13,8 @@ module.exports =
|
|||
apis:
|
||||
web:
|
||||
url: "http://localhost:3000"
|
||||
user: "sharelatex"
|
||||
pass: "password"
|
||||
documentupdater:
|
||||
url: "http://localhost:3003"
|
||||
trackchanges:
|
||||
|
|
|
@ -15,6 +15,8 @@ describe 'WebApiManager', ->
|
|||
apis:
|
||||
web:
|
||||
url: "http://web.example.com"
|
||||
user: "username"
|
||||
pass: "password"
|
||||
"logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub() }
|
||||
|
||||
describe "joinProject", ->
|
||||
|
@ -33,6 +35,10 @@ describe 'WebApiManager', ->
|
|||
url: "#{@settings.apis.web.url}/project/#{@project_id}/join"
|
||||
qs:
|
||||
user_id: @user_id
|
||||
auth:
|
||||
user: @settings.apis.web.user
|
||||
pass: @settings.apis.web.pass
|
||||
sendImmediately: true
|
||||
json: true
|
||||
jar: false
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue