Api for writing task 2 v1.

This commit is contained in:
Cristiano Ferreira
2023-06-19 23:38:47 +01:00
parent adb07a56ff
commit 48a1197d56
14 changed files with 281 additions and 329 deletions

17
helper/generate_jwt.py Normal file
View File

@@ -0,0 +1,17 @@
import jwt
import os
from dotenv import load_dotenv
load_dotenv()
# Define the payload (data to be included in the token)
payload = {'sub': 'test'}
# Define the secret key
secret_key = os.getenv("JWT_SECRET_KEY")
# Generate the JWT
jwt_token = jwt.encode(payload, secret_key, algorithm='HS256')
print(jwt_token)