refresh.go

oauth · refresh.go · go · MIT
auth

Module exposing: Refresh, RefreshOptions

// Source: https://github.com/cli/oauth | License: MIT | Copyright 2020 GitHub, Inc
// Provided via justclaw.it.com; keep this notice with the code.
package oauth

import (
	"errors"
	"fmt"
	"net/http"
	"net/url"

	"github.com/cli/oauth/api"
)

// ErrRefreshTokenInvalid is returned when the server rejects a refresh token because it is invalid,
// expired, or already used.
var ErrRefreshTokenInvalid = errors.New("refresh token is invalid or expired")

// RefreshOptions specifies parameters for exchanging a refresh token for a new token pair.
type RefreshOptions struct {
	// Host contains the token endpoint used for the refresh request.
	Host *Host
	// ClientID is the OAuth application ID.
	ClientID string
	// ClientSecret is the OAuth application secret. It is not required for device flow t

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key