tglogin

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2024 License: Apache-2.0, MIT Imports: 5 Imported by: 0

README

tglogin - Provides authentication for Telegram login widget

Exports

  • TelegramUser struct - contains user data and a hash for authentication
    • IsValid(botToken string) bool - returns true if TelegramUser is valid

Documentation from Telegram

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginUser

type LoginUser struct {
	ID        int    `json:"id"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name,omitempty"`
	Username  string `json:"username,omitempty"`
	PhotoUrl  string `json:"photo_url,omitempty"`
	AuthDate  int    `json:"auth_date"`
	Hash      string `json:"hash"`
}

LoginUser is a user data received from Telegram

func (LoginUser) IsFromTelegram

func (v LoginUser) IsFromTelegram(botToken string) bool

IsFromTelegram checks if the user data are signed with given Telegram bot token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL