From c377909954a9e6df6d596edb66b69869b12a260d Mon Sep 17 00:00:00 2001 From: Swapnil Date: Wed, 24 Jan 2024 18:59:37 +0530 Subject: [PATCH] fix: database check --- database/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/database/main.py b/database/main.py index 9537bff..54c2ada 100644 --- a/database/main.py +++ b/database/main.py @@ -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()