feat: restrict search functionality to authenticated users only
This commit is contained in:
parent
f920ff4740
commit
0f8801fa1e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user