minor changes

manzilcheck
Kushal Dotel 6 months ago
parent 47fc49ff9f
commit dd5ceda5ac
  1. 2
      backend/app.py
  2. 2
      backend/utils/auth.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'])

@ -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

Loading…
Cancel
Save