Files
full-stack-fastapi-postgresql/{{cookiecutter.project_slug}}/backend/app/app/tests/utils/user.py
Sebastián Ramírez 7f8bfc8faa 🎉 First commit, from couchbase generator, basic changes
not tested / updated yet
2019-02-09 19:42:36 +04:00

14 lines
392 B
Python

import requests
from app.core import config
def user_authentication_headers(server_api, email, password):
data = {"username": email, "password": password}
r = requests.post(f"{server_api}{config.API_V1_STR}/login/access-token", data=data)
response = r.json()
auth_token = response["access_token"]
headers = {"Authorization": f"Bearer {auth_token}"}
return headers