0

It's gonna be something like:

@app.route('/phone_code', methods=['POST'])
def get_phone_code():
    return request.args.get('phone_code')

@app.route('/sign_in', methods=['GET', 'POST'])
def sign_in():
    with pyrogram.Client(
        phone_number=request.args.get('phone_number')
        phone_code=get_phone_code()) as client:
        pass
    return 'some specific server stuff'

So how can I get the code from get_phone_code using another Flask request?

UPD: First I need to call sign_in() which runs send_code() function and generates phone_code_hash which is used to check the validity of the phone_code so sign_in() must be called before getting phone_code

sybrpnk
  • 9
  • 2
  • Save that phone_code to database and query the database – bigbounty Feb 26 '19 at 05:04
  • @bigbounty first I need to call `sign_in()` which runs `send_code()` function and generates `phone_code_hash` which is used to check the validity of the `phone_code` so `sign_in()` must be called before getting `phone_code` – sybrpnk Feb 26 '19 at 05:15

0 Answers0