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. Why Is Web Development Essential For Small Businesses?Author: Liam Mackie
2. The Importance Of Ecommerce Website Development For Business Growth
Author: Lahari Technologies
3. Web-design Services At Best Rates || Brand Roof Solutions
Author: Brand Roof Solutions
4. Seo Services In India And Web Design Company In Balasore For Complete Digital Growth
Author: Ethan Davis
5. Hire The Best Node.js Developers In Riyadh, Saudi Arabia
Author: Andy
6. Web Design Agency Dubai: Understanding Modern Website Solutions
Author: easywebplansitllc67
7. Advanced Web3 Ui Ux Design Systems For Growing Brands
Author: david
8. Back To Winter With Slope Rider
Author: sloperider3d
9. Hire The Best Next.js Developers In Riyadh, Saudi Arabia
Author: Andy
10. Simple Tricks That Will Work In Favour Of Your Ecommerce Website Design!
Author: Liam Mackie
11. Penetration Testing & Vulnerability Assessment Services
Author: brainbell10
12. Pay Per Click
Author: brainbell10
13. React.js Development Services In Riyadh For Fast, Scalable Web Apps
Author: Andy
14. Powering Business Growth With Smart Digital Innovation
Author: sochtek
15. Hire Dedicated Laravel Developers In Riyadh: Best Laravel Development Company
Author: Andy






