From dd5ceda5ac0a9b424db8a6a929629231b0e74f8e Mon Sep 17 00:00:00 2001 From: Kushal Dotel Date: Sat, 11 Jan 2025 16:49:51 +0545 Subject: [PATCH] minor changes --- backend/app.py | 2 +- backend/utils/auth.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app.py b/backend/app.py index b8b9f05..b4b06a0 100644 --- a/backend/app.py +++ b/backend/app.py @@ -22,7 +22,7 @@ app.config["SQLALCHEMY_DATABASE_URI"] = DB_URI db.init_app(app) -app.register_blueprint(profileBlueprint, url_prefix='/api') +app.register_blueprint(profileBlueprint, url_prefix='/api/profile') @app.route('/', methods=['GET', 'POST']) diff --git a/backend/utils/auth.py b/backend/utils/auth.py index f28b5f9..fb490cd 100644 --- a/backend/utils/auth.py +++ b/backend/utils/auth.py @@ -20,7 +20,7 @@ def requires_role(roles: Union[None, UserRole] = None): except IndexError: return jsonify({'error': 'Invalid authorization header format'}), 401 session: Session = db.session.execute( - select(User).where(and_(Session.key == session_key, Session.isValid == True)) + select(Session).where(and_(Session.key == session_key, Session.isValid == True)) ).scalar() if not session: return jsonify({'error': 'Invalid or expired session'}), 401