blitss / passport-telegram-strategy Goto Github PK
View Code? Open in Web Editor NEWPassport strategy for Telegram Login widget
Passport strategy for Telegram Login widget
I really appreciate this implementation of the official Telegram oAuth system. I am currently developing a new little service and immediately chose to use it.
In my tests, I discovered that if I am running a listener myself, the server process that's running the express site (and the passport auth) will be in conflict with it all.
I wonder how this can be worked with. Does the oAuth actually need the Telegram SDK? Does it have to run polling? Is there a way around this?
But also Webhooks might be problematic as I already use those with the second listening process. Seems like this is not going to be all too easy. I hope you can help ๐ช.
Hey,
PassportJS has info about default profile scheme that return strategy.
What about also using that profile scheme?
Hi, maybe I'm wrong, but I have issues getting the Telegram login to work.
I included it via
var TelegramStrategy = require('passport-telegram-official').Strategy;
and used later in the code
passport.use(new TelegramStrategy(
but I get the following error:
TypeError: TelegramStrategy is not a constructor
What am I doing wrong?
Thank you for your help!
Here is my code:
https://github.com/BitDesert/MyNanoNinja/blob/telegram-login/config/passport.js#L8
https://github.com/BitDesert/MyNanoNinja/blob/telegram-login/config/passport.js#L513
I have a problem importing the package in TypeScript, although both of these methods work and actually import the module but still, TypeScript yells at me "What are you doing".
First method:
import * as TelegramStrategy from 'passport-telegram-official';
// [ts] Module '".../node_modules/passport-telegram-official/dist/index"' resolves to a non-module entity and cannot be imported using this construct.
Second method:
import TelegramStrategy = require('passport-telegram-official');
// [ts] Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
Seems like you're using export = TelegramStrategy
which is kinda outdated. So if you use export default
we can easily import it as default:
export default TelegramStrategy;
// later
import TelegramStrategy from 'passport-telegram-official';
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.