Skip to main content

auth.importLoginToken

Login using a redirected login token, generated in case of DC mismatch during QR code login. For more info, see login via QR code.

func (c *Client) AuthImportLoginToken(ctx context.Context, token []byte) (AuthLoginTokenClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.AuthImportLoginToken(ctx, token)
if err != nil {
return err
}
_ = res // AuthLoginTokenClass
return nil
})

Parameters

NameTypeRequiredDescription
Token[]byteyesLogin token

Returns

AuthLoginTokenClass

Possible errors

CodeTypeDescription
400AUTH_TOKEN_ALREADY_ACCEPTEDThe specified auth token was already accepted.
400AUTH_TOKEN_EXPIREDThe authorization token has expired.
400AUTH_TOKEN_INVALIDThe specified auth token is invalid.
400AUTH_TOKEN_INVALIDXThe specified auth token is invalid.

References