Documentation
¶
Index ¶
Constants ¶
View Source
const (
MaxDataAge = 24 * time.Hour
)
Variables ¶
View Source
var ( ErrInvalidHash = errors.New("invalid hash") ErrUserFieldMissing = errors.New("user field missing") ErrAuthDateMissing = errors.New("auth_date field missing") ErrAuthDateInvalid = errors.New("invalid auth_date") ErrDataExpired = errors.New("data is too old") ErrInvalidDataFormat = errors.New("invalid data format") )
Functions ¶
This section is empty.
Types ¶
type WebAppUser ¶
type WebAppUser struct {
ID int `json:"id"`
IsBot bool `json:"is_bot"`
IsPremium bool `json:"is_premium"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Username string `json:"username"`
LanguageCode string `json:"language_code"`
AddedToAttachmentMenu bool `json:"added_to_attachment_menu"`
AllowsWriteToPm bool `json:"allows_write_to_pm"`
PhotoURL string `json:"photo_url"`
}
func VerifyWebAppData ¶
func VerifyWebAppData(telegramInitData, token string) (WebAppUser, error)
Click to show internal directories.
Click to hide internal directories.