Skip to main content

auth.acceptLoginToken

Accept QR code login token, logging in the app that generated it. Returns info about the new session. For more info, see login via QR code.

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

Calling this method

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

res, err := api.AuthAcceptLoginToken(ctx, token)
if err != nil {
return err
}
_ = res // *Authorization
return nil
})

Parameters

NameTypeRequiredDescription
Token[]byteyesLogin token embedded in QR code, for more info, see login via QR code.

Returns

*Authorization

Possible errors

CodeTypeDescription
400AUTH_TOKEN_ALREADY_ACCEPTEDThe specified auth token was already accepted.
400AUTH_TOKEN_EXCEPTIONAn error occurred while importing the auth token.
400AUTH_TOKEN_EXPIREDThe authorization token has expired.
400AUTH_TOKEN_INVALIDXThe specified auth token is invalid.

References