mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #145 from sharelatex/ho-login-smoke-tests-2
use /dev/csrf for smoke tests
This commit is contained in:
commit
c846f5dcc0
1 changed files with 3 additions and 7 deletions
|
@ -33,17 +33,13 @@ describe "Opening", ->
|
|||
return done(err)
|
||||
logger.log "smoke test: clearing rate limit "
|
||||
require("../../../app/js/infrastructure/RateLimiter.js").clearRateLimit "open-project", "#{Settings.smokeTest.projectId}:#{Settings.smokeTest.userId}", ->
|
||||
logger.log "smoke test: hitting /login"
|
||||
logger.log "smoke test: hitting dev/csrf"
|
||||
command = """
|
||||
curl -H "X-Forwarded-Proto: https" -c #{cookeFilePath} #{buildUrl('login')}
|
||||
curl -H "X-Forwarded-Proto: https" -c #{cookeFilePath} #{buildUrl('dev/csrf')}
|
||||
"""
|
||||
child.exec command, (err, stdout, stderr)->
|
||||
if err? then done(err)
|
||||
csrfMatches = stdout.match("<input name=\"_csrf\" type=\"hidden\" value=\"(.*?)\">")
|
||||
if !csrfMatches?
|
||||
logger.err stdout:stdout, "smoke test: does not have csrf token"
|
||||
return done("smoke test: does not have csrf token")
|
||||
csrf = csrfMatches[1]
|
||||
csrf = stdout
|
||||
logger.log "smoke test: converting cookie file 1"
|
||||
convertCookieFile (err) ->
|
||||
return done(err) if err?
|
||||
|
|
Loading…
Reference in a new issue