Implement login with secure password rehashing

This commit is contained in:
2020-10-05 15:35:13 +02:00
parent f37b7392e2
commit 3bb09dbaea
4 changed files with 69 additions and 23 deletions

View File

@@ -1,4 +1,3 @@
from pytest import mark
from secrets import token_hex
from app.schemas import *
@@ -24,19 +23,6 @@ def test_registration():
assert response.status_code == 200
@mark.skip(reason="not implemented")
def test_login():
user = {
"email": "12@gmail.com",
"password": "odyfo2020",
"device_id": "fEll6hxazGQ:APA91bFpsB44ZHgjUItYOKTTmUxxkJsWiuaeojdxiTLVbz-AwN90XwLvpA6nRQoLrUYaF-HoHTz4Vc5S0VlqemerJ6MjG4zqwfNYB75whQVQI1M29yhMc3oFdl1me2zP_RY2dXbfx7UW",
"lang_type": 2,
"user_type": 1,
}
response = client.post("/login", json=user)
assert response.status_code == 200
def test_otp_verification(get_test_db):
user = get_test_db.query(Users).filter(Users.email == "oyvey@hotmail.com").first()
data = {
@@ -47,6 +33,18 @@ def test_otp_verification(get_test_db):
assert response.status_code == 200
def test_login():
user = {
"email": "testorganizer@odyfo.com",
"password": "odyfo2020",
"device_id": "0",
"lang_type": 1,
"user_type": 2,
}
response = client.post("/login", json=user)
assert response.status_code == 200
def test_resend_otp():
data = {
"email": "testorganizer@odyfo.com",