Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRateLimited = errors.New("rate limited")
ErrRateLimited marks a login failure caused by the auth API rate limiting the caller. It is wrapped into the returned error so callers can react to it with errors.Is without depending on a concrete error type or HTTP status code.
View Source
var ErrUnknownPollID = errors.New("unknown ID")
ErrUnknownPollID marks a poll for a sign-in the auth api does not know, or no longer knows: it expired or its token was already released.
Functions ¶
func DeriveToken ¶
func DeriveToken(ctx *appcontext.AppContext) (string, error)
func NewLoginFlow ¶
func NewLoginFlow(appCtx *appcontext.AppContext, noSpawn bool) (*loginFlow, error)
Types ¶
type PollStatus ¶ added in v1.1.7
type PollStatus int
PollStatus is where a sign-in stands after one poll of the auth api.
const ( // PollPending: the user has not completed the sign-in yet. PollPending PollStatus = iota // PollCodeRequired: the sign-in is complete but the token is only // released against the completion code, and none or a wrong one was sent. PollCodeRequired // PollDone: the token was released. PollDone )
type TokenResponse ¶
type TokenResponse struct {
Token string `json:"token"`
}
Click to show internal directories.
Click to hide internal directories.