package qrlogin

Import Path
	github.com/gotd/td/telegram/auth/qrlogin (on go.dev)

Dependency Relation
	imports 10 packages, and imported by one package

Involved Source Files accept.go errors.go options.go Package qrlogin provides QR login flow implementation. See https://core.telegram.org/api/qr-login. token.go
Package-Level Type Names (total 5, all are exported)
/* sort exporteds by: | */
LoggedIn is signal channel to notify about tg.UpdateLoginToken. func OnLoginToken(d interface{OnLoginToken(tg.LoginTokenHandler)}) LoggedIn func QR.Auth(ctx context.Context, loggedIn LoggedIn, show func(ctx context.Context, token Token) error, exceptIDs ...int64) (*tg.AuthAuthorization, error)
MigrationNeededError reports that Telegram requested DC migration to continue login. MigrateTo *tg.AuthLoginTokenMigrateTo Tried indicates that the migration was attempted. Deprecated: do not use. QR login uses migrate function passed via options. Error implements error. *MigrationNeededError : error
Options of QR. Clock clock.Clock Migrate func(ctx context.Context, dcID int) error func NewQR(api *tg.Client, appID int, appHash string, opts Options) QR
QR implements Telegram QR login flow. Accept accepts given token. See https://core.telegram.org/api/qr-login#accepting-a-login-token. Auth generates new QR login token, shows it and awaits acceptation. NB: Show callback may be called more than once if QR expires. Export exports new login token. See https://core.telegram.org/api/qr-login#exporting-a-login-token. Import imports accepted token. See https://core.telegram.org/api/qr-login#confirming-importing-the-login-token. func NewQR(api *tg.Client, appID int, appHash string, opts Options) QR func github.com/gotd/td/telegram.(*Client).QR() QR
Token represents Telegram QR Login token. Expires returns token expiration time. Image returns QR image. String implements fmt.Stringer. URL returns login URL. See https://core.telegram.org/api/qr-login#exporting-a-login-token. Token : fmt.Stringer func NewToken(token []byte, expires int) Token func ParseTokenURL(u string) (Token, error) func QR.Export(ctx context.Context, exceptIDs ...int64) (Token, error) func AcceptQR(ctx context.Context, raw *tg.Client, t Token) (*tg.Authorization, error) func QR.Accept(ctx context.Context, t Token) (*tg.Authorization, error)
Package-Level Functions (total 5, all are exported)
AcceptQR accepts given token. See https://core.telegram.org/api/qr-login#accepting-a-login-token.
NewQR creates new QR
NewToken creates new Token.
OnLoginToken sets handler for given dispatcher and returns signal channel.
ParseTokenURL creates Token from given URL.