Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login Telegram widget #1

Closed
gevera opened this issue Jun 9, 2022 · 6 comments
Closed

Login Telegram widget #1

gevera opened this issue Jun 9, 2022 · 6 comments

Comments

@gevera
Copy link

gevera commented Jun 9, 2022

Hi there. Thanks for all your work integrating my favorite two tools. Any ways to implement a telegram login widget ?

I am planning to use Telegram in my Svelte app as auth provider.
Best regards

@amr3k
Copy link
Owner

amr3k commented Jun 11, 2022

Hi, this is interesting idea, I didn't plan it from the beginning, but I have no problem with adding it.

Let me see what I can do.

Also all contributions are welcome.

Thanks

@gevera
Copy link
Author

gevera commented Jun 18, 2022

Hey, thanks for the reply. I've done something similar to this https://github.com/vchaptsev/vue-telegram-login/tree/master/src , however something is missing and I can't figure it out

@amr3k
Copy link
Owner

amr3k commented Jun 18, 2022

I messed around with it two days ago, and I have an issue defining a global function from a svelte component.

I tried using window.onTelegramAuth = (user) => console.log(user); but it didn't work after authenticating with Telegram, it gives me a ReferenceError.

@gevera
Copy link
Author

gevera commented Jun 18, 2022

I messed around with it two days ago, and I have an issue defining a global function from a svelte component.

I tried using window.onTelegramAuth = (user) => console.log(user); but it didn't work after authenticating with Telegram, it gives me a ReferenceError.

Did you try

<svelte:window on:loginSuccess={loginSuccess}></

???

Or maybe you could you share your code or working branch. Maybe i could come up with something

@amr3k
Copy link
Owner

amr3k commented Jun 19, 2022

I just pushed v1.0.0 release including support for login button.

Let me know what do you think :)

@gevera
Copy link
Author

gevera commented Jun 20, 2022

Works like a charm. You're the man! Thank you

@gevera gevera closed this as completed Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants