nodegin / tglib

TDLib (Telegram Database library) bindings for Node.js
114 stars 16 forks source link

authorization isn't done for users who aren't signed up before #24

Closed proboys closed 6 years ago

proboys commented 6 years ago

please add code to client.js => handleAuth => case authorizationStateWaitCode:

      case 'authorizationStateWaitCode': {
        let first_name = ''
        if(!update['authorization_state']['is_registered'])
          first_name = await getInput('input', 'Please enter first_name: ')
        const code = await getInput('input', 'Please enter auth code: ')
        this._send({
          '@type': 'checkAuthenticationCode',
          'code': code,
          'first_name' : first_name
        })
        break
      }

i got it from here

nodegin commented 6 years ago

This is now in release 1.4.0! Thanks for reporting.