login

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorFrom

func ErrorFrom(ctx context.Context) error

ErrorFrom returns the login error from the context.

func WithError

func WithError(parent context.Context, err error) context.Context

WithError returns a parent context with the error.

func WithToken

func WithToken(parent context.Context, token *Token) context.Context

WithToken returns a parent context with the token.

Types

type Middleware

type Middleware interface {
	// Handler returns a http.Handler that runs h at the
	// completion of the authorization flow. The authorization
	// results are available to h in the http.Request context.
	Handler(h http.Handler) http.Handler
}

Middleware provides login middleware.

type Token

type Token struct {
	Access  string
	Refresh string
	Expires time.Time
}

Token represents an authorization token.

func TokenFrom

func TokenFrom(ctx context.Context) *Token

TokenFrom returns the login token rom the context.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL