Fix logging in in prebuilds
This commit is contained in:
parent
abd60caa09
commit
fae6bc9184
|
@ -34,7 +34,7 @@ tasks:
|
|||
# Login with cURL to create actors
|
||||
docker-compose up -d nginx
|
||||
gp ports await 8000
|
||||
sleep 20 # allow django to start
|
||||
sleep 10
|
||||
python .gitpod/init_actor.py
|
||||
|
||||
# Import music
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
import subprocess
|
||||
import requests
|
||||
|
||||
INSTANCE_URL = subprocess.check_output(['gp', 'url', '8000']).decode()[:-1]
|
||||
|
||||
# Login to initialize user actor
|
||||
req = requests.Session()
|
||||
|
||||
res = req.get(INSTANCE_URL + '/login')
|
||||
res = req.get('http://localhost:8000/login')
|
||||
token = res.cookies['csrftoken']
|
||||
|
||||
req.post(INSTANCE_URL + '/api/v1/users/login', data={
|
||||
req.post('http://localhost:8000/api/v1/users/login', data={
|
||||
'username': 'gitpod',
|
||||
'password': 'gitpod'
|
||||
}, headers={
|
||||
'Referer': INSTANCE_URL + '/login',
|
||||
'Referer': 'http://localhost:8000/login',
|
||||
'X-CSRFTOKEN': token
|
||||
})
|
||||
|
||||
req.get(INSTANCE_URL)
|
||||
req.get('http://localhost:8000')
|
Loading…
Reference in New Issue