ALL >> Web-Design >> View Article
Vue 3 Telegram Login
Installation
You've to run this command to install it with npm:
$ npm i vue3-telegram-login --save
Usage
Next, You've to Import telegram-login-temp, pass it to the component, and then you can utilize it in your template.
Loading...
import { telegramLoginTemp } from 'vue3-telegram-login'
import { ref } from 'vue'
const isLoaded = ref(false)
function telegramLoadedCallbackFunc () {
console.log('script is loaded')
isLoaded.value = true
}
function yourCallbackFunction (user) {
// gets user as an input
// id, first_name, last_name, username,
// photo_url, auth_date and hash
console.log(user)
}
Closing Notes
You need to set the domain to your bot if you want to use Telegram Login (/setdomain command to @BotFather)
You've to validate the authentication and the integrity of the data received by correlating the received hash parameter with the hexadecimal representation of the HMAC-SHA-256 signature of the data-check-string with the SHA256 hash of the bot's token utilized as a secret key (source).
You can observe some code samples on this page.
Don't disable third party cookies if you want to use Telegram Login as a User (thanks @robverhoef )
Add Comment
Web Design Articles
1. Ecommerce Website Design: Building The Foundation Of Your Company’s Digital Success Story!Author: Liam Mackie
2. Custom Web Design And Development Company In Jaipur
Author: STPL
3. Top Website Development Company In Aerocity Mohali | Sochtek
Author: sochtek
4. Fix Slow Websites And Common Technical Problems
Author: Mohammed Yusri
5. Strapi & Headless Forms: Streamlining Lead Capture & Registrations
Author: Andy
6. Strapi & Gatsby: Powering Lightning-fast, Omnichannel E-commerce Experiences
Author: Andy
7. Complete Guide To Building A Successful Ecommerce Store
Author: Smith Olivia
8. Top Laravel Web Development Company For Scalable Solutions
Author: Arun Singh
9. Professional Strapi Development Services For Custom Headless Cms Solutions
Author: Andy
10. Why Is Web Development Essential For Small Businesses?
Author: Liam Mackie
11. The Importance Of Ecommerce Website Development For Business Growth
Author: Lahari Technologies
12. Web-design Services At Best Rates || Brand Roof Solutions
Author: Brand Roof Solutions
13. Seo Services In India And Web Design Company In Balasore For Complete Digital Growth
Author: Ethan Davis
14. Hire The Best Node.js Developers In Riyadh, Saudi Arabia
Author: Andy
15. Web Design Agency Dubai: Understanding Modern Website Solutions
Author: easywebplansitllc67






