node-telegram-login
Check Telegram Login Widget hash manually or with an express.js middleware
Installation
Install through npm:
npm install --save node-telegram-login
Usage
Use it in your app like so:
const TOKEN = '<BOT_TOKEN>'const TelegramLogin = ;const MySiteLogin = TOKEN; ifMySiteLogin console;if!MySiteLogin console
You can use it like an express.js middleware like this:
const TOKEN = '<BOT_TOKEN>'const TelegramLogin = ;const MySiteLogin = TOKEN; app;
Also it is possible to set a custom middleware with specified success and fail functions. Success function will be called with req, res, next and the login_data. Fail function will be called with req, res, next arguments. In this case you are responsable of calling next()
const TOKEN = '<BOT_TOKEN>'const TelegramLogin = ;const MySiteLogin = TOKEN; let { reslocalstelegram_user = login_data; ;} let { res;} app;