feat: restrict search functionality to authenticated users only

This commit is contained in:
Manuel Weiser 2024-09-02 17:13:39 +02:00
parent f920ff4740
commit 0f8801fa1e

View File

@ -52,6 +52,9 @@ def get_games():
@app.route('/games/search', methods=['GET'])
def search_game_api():
if not authenticate(): # Ensure the user is authenticated
return jsonify({'message': 'Unauthorized access!'}), 401
search_term = request.args.get('search_keywords')
if not search_term:
return jsonify({'message': 'No search term provided!'}), 400