This commit is contained in:
2024-03-28 10:36:00 -04:00
parent 52172812cb
commit 666d0895e4
49 changed files with 225 additions and 744 deletions

0
app/auth/__init__.py Normal file → Executable file
View File

4
app/auth/views.py Normal file → Executable file
View File

@@ -12,13 +12,14 @@ def check_session():
"""
Checks auth token to ensure user is authenticated
"""
api_key = request.headers.get('Authorization')
if not api_key:
return jsonify({"error": "True"}), 200
else:
api_key = api_key.replace('bearer ', '', 1)
api_key = api_key.replace('"', '')
user_exists = (db.session
.query(Auth_User)
.filter(Auth_User.api_key == api_key)
@@ -30,6 +31,7 @@ def check_session():
.query(Auth_User)\
.filter(Auth_User.api_key == api_key)\
.first()
return jsonify({
"ok": True,
'user': {