feat: add verification; add auth - change password and logout

This commit is contained in:
firedotguy
2026-01-30 16:12:05 +03:00
parent aa20199ebe
commit 1a606da55f
6 changed files with 61 additions and 9 deletions

10
itd/routes/auth.py Normal file
View File

@@ -0,0 +1,10 @@
from itd.request import auth_fetch
def refresh_token(cookies: str):
return auth_fetch(cookies, 'post', 'v1/auth/refresh')['accessToken']
def change_password(cookies: str, token: str, old: str, new: str):
return auth_fetch(cookies, 'post', 'v1/auth/change-password', {'newPassword': new, 'oldPassword': old}, token)
def logout(cookies: str):
return auth_fetch(cookies, 'post', 'v1/auth/logout')