Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,9 +47,8 @@ def api_videos():
|
|
| 47 |
response.headers['Access-Control-Allow-Origin'] = '*'
|
| 48 |
return response
|
| 49 |
|
| 50 |
-
@app.route('/api/send_code', methods=['POST'
|
| 51 |
async def api_send_code():
|
| 52 |
-
if request.method == 'OPTIONS': return jsonify({"status": "ok"})
|
| 53 |
data = request.json
|
| 54 |
phone = data.get('phone')
|
| 55 |
client = Client(f"session_{phone}", api_id=API_ID, api_hash=API_HASH, in_memory=True)
|
|
@@ -61,9 +60,8 @@ async def api_send_code():
|
|
| 61 |
except Exception as e:
|
| 62 |
return jsonify({"status": "error", "msg": str(e)})
|
| 63 |
|
| 64 |
-
@app.route('/api/verify_code', methods=['POST'
|
| 65 |
async def api_verify_code():
|
| 66 |
-
if request.method == 'OPTIONS': return jsonify({"status": "ok"})
|
| 67 |
data = request.json
|
| 68 |
phone, otp, hash, u_id = data.get('phone'), data.get('otp'), data.get('hash'), data.get('user_id')
|
| 69 |
entry = temp_clients.get(phone)
|
|
|
|
| 47 |
response.headers['Access-Control-Allow-Origin'] = '*'
|
| 48 |
return response
|
| 49 |
|
| 50 |
+
@app.route('/api/send_code', methods=['POST'])
|
| 51 |
async def api_send_code():
|
|
|
|
| 52 |
data = request.json
|
| 53 |
phone = data.get('phone')
|
| 54 |
client = Client(f"session_{phone}", api_id=API_ID, api_hash=API_HASH, in_memory=True)
|
|
|
|
| 60 |
except Exception as e:
|
| 61 |
return jsonify({"status": "error", "msg": str(e)})
|
| 62 |
|
| 63 |
+
@app.route('/api/verify_code', methods=['POST'])
|
| 64 |
async def api_verify_code():
|
|
|
|
| 65 |
data = request.json
|
| 66 |
phone, otp, hash, u_id = data.get('phone'), data.get('otp'), data.get('hash'), data.get('user_id')
|
| 67 |
entry = temp_clients.get(phone)
|