fix: database check

This commit is contained in:
Swapnil 2024-01-24 18:59:37 +05:30
parent 34282e6f30
commit c377909954
Signed by: swapnil
GPG Key ID: 58029C48BB100574
1 changed files with 3 additions and 0 deletions

View File

@ -29,6 +29,9 @@ def create_token():
refresh_token = data.get('refresh_token')
expiration_seconds = data.get('expiration_seconds')
if not access_token or not refresh_token or not expiration_seconds:
return 'Missing required fields', 400
new_token = Token(access_token=access_token, refresh_token=refresh_token, expiration_seconds=expiration_seconds)
db.session.add(new_token)
db.session.commit()