Implement login API, closes #1 #2

Open
BlackCorbeau wants to merge 25 commits from dev into main
Showing only changes of commit 0e668e1993 - Show all commits
+7
View File
@@ -0,0 +1,7 @@
import jwt
import os
def generateKey(email, passwd):
key = os.getenv('KEY')
encoded = jwt.encode({f"{email}": f"{passwd}"}, key, algorithm="HS256")
Outdated
Review

1. encoded = jwt.encode({email: passwd}, key, algorithm="HS256")
2. Добавь iat, на всякий случай

~~1. `encoded = jwt.encode({email: passwd}, key, algorithm="HS256")`~~ 2. Добавь [`iat`](https://pyjwt.readthedocs.io/en/latest/usage.html#issued-at-claim-iat), на всякий случай
return encoded