DmitrMakeev commited on
Commit
94a58b1
·
verified ·
1 Parent(s): ae93c3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -201,6 +201,11 @@ def get_db_connection_user():
201
 
202
  @app.route('/user_db', methods=['GET'])
203
  def get_user():
 
 
 
 
 
204
  email = request.args.get('email')
205
  vk_id = request.args.get('vk_id')
206
  phone = request.args.get('phone')
@@ -254,7 +259,6 @@ def get_user():
254
  return jsonify({"error": "User not found"}), 404
255
 
256
 
257
-
258
  # Отдаем дату онлайн
259
  @app.route('/get_current_time', methods=['GET'])
260
  def get_current_time():
 
201
 
202
  @app.route('/user_db', methods=['GET'])
203
  def get_user():
204
+ # Проверка API-ключа
205
+ api_key_sys_control = request.args.get('api_sys')
206
+ if api_key_sys_control != api_key_sys:
207
+ return jsonify({"error": "Invalid API key"}), 403
208
+
209
  email = request.args.get('email')
210
  vk_id = request.args.get('vk_id')
211
  phone = request.args.get('phone')
 
259
  return jsonify({"error": "User not found"}), 404
260
 
261
 
 
262
  # Отдаем дату онлайн
263
  @app.route('/get_current_time', methods=['GET'])
264
  def get_current_time():