Revize 0fcb708f
Přidáno uživatelem Matěj Zeman před více než 2 roky(ů)
server/sql_app/api/auth.py | ||
---|---|---|
50 | 50 |
|
51 | 51 |
|
52 | 52 |
def verify_password(plain_password, hashed_password): |
53 |
""" |
|
54 |
Verifies plain text password with hashed password |
|
55 |
""" |
|
53 | 56 |
return pwd_context.verify(plain_password, hashed_password) |
54 | 57 |
|
55 | 58 |
|
56 | 59 |
def get_hash_password(password): |
60 |
""" |
|
61 |
Returns hashed password |
|
62 |
""" |
|
57 | 63 |
return pwd_context.hash(password) |
58 | 64 |
|
59 | 65 |
|
60 | 66 |
def auth_user(db, username: str, password: str): |
67 |
""" |
|
68 |
Determines if given password belongs to user with given username |
|
69 |
""" |
|
61 | 70 |
user = crud.find_user(db, username) |
62 | 71 |
if not user: |
63 | 72 |
return None |
Také k dispozici: Unified diff
re #9846 Changed keyman devices, body devices views. Added Head devices view. Changed filtering of logs, ldlogs, body devices, head devices and keyman devices. Changed HTML tables style and few labels.