Qr code login
See original GitHub issueFirst of all, awesome works guys!
I’m trying to login via qr code, so, reading the docs I generated a login token via:
...
const client = new TelegramClient(stringSession, Number(apiId), apiHash, {
connectionRetries: 5,
});
await client.connect();
const loginToken: Api.auth.TypeLoginToken = await client.invoke(
new Api.auth.ExportLoginToken({
apiId: Number(apiId),
apiHash,
exceptIds: [9505834],
}),
);
if (!(loginToken instanceof Api.auth.LoginToken)) {
return;
}
console.log(`tg://login?token=${loginToken.token.toString('base64url')}`);
...
After that, I scanned the returned url in my phone. So, how can I start the client using this token? what is the correct use of client.start(<AuthUser>)? The AuthuUser interface impose phoneCode use, but I want to login only via qr code.
Thanks for the help.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Login - QR Code Generator PRO
No account yet? Sign up. . Email. . Password. Keep me signed in. Forgot password? Log In. or. Sign in with a Google...
Read more >QR Code Generator | Create Your Free QR Codes
QR Code Generator for URL, vCard, and more. Add logo, colors, frames, and download in high print quality. Get your free QR Codes...
Read more >How to Use QR Codes For Easier Login Authentication Across ...
Deploy QR codes designed especially for mobile apps. ... Using QR codes, you can make the login process an excellent user experience.
Read more >Login - Free Custom QR Code Maker and Creator with logo
Log In to Your QR Tiger Account! Continue with Google. Remember me. Sign in. Forgot password. Don't have an account?
Read more >How to Create Student Clever QR Codes to Log In - YouTube
How to Create Student Clever QR Codes to Log In ... QR Code login using Laravel and qrcode.js. WebDevWithArtisan. WebDevWithArtisan.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Should be fixed in latest patch. There was actually a piece of code in the library that made qr login broken 😕 I’ve added an example in the docs as well.
There is already a helper method for QR codes. signInUserWithQrCode. you can take a look on how it implements it.
Basically after you scan the code telegram would send you an event. after which you need to call ExportLoginToken again.