auth.checkPassword

Try logging to an account protected by a 2FA password.

Example

const {Api, TelegramClient} = require('telegram');
const {StringSession} = require('telegram/sessions');

const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
    const result = await client.invoke(new Api.auth.checkPassword({
        password: new Api.InputCheckPasswordSRP({...}),
        }));
    console.log(result); // prints the result
})();

TL schema

auth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;
auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;
---functions---
auth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization;

Parameters

Result

auth.Authorization

Possible errors

Can bots use this methd ?

yes

How to login to a user's account if they have enabled 2FA, how to change password.

Last updated