auth

package
v0.0.0-...-5dbc853 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2015 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthenticated      = chatable.NewAuthenticationError("Unauthenticated")
	ErrAlreadyAuthenticated = chatable.NewAuthenticationError("Already authenticated")
	ErrUserNotFound         = chatable.NewAuthenticationError("User not found")
	ErrUnauthorized         = chatable.NewAuthenticationError("Unauthorized")
)

Functions

func ActiveUser

func ActiveUser(r *http.Request) *chatable.User

ActiveUser gets the authenticated user from request.

func TokenAuthenticate

func TokenAuthenticate(w http.ResponseWriter, r *http.Request) chatable.CompoundError

TokenAuthenticate authenticates a token from request.

func TokenUnAuthenticate

func TokenUnAuthenticate(w http.ResponseWriter, r *http.Request) chatable.CompoundError

TokenUnAuthenticate deactivates a token.

Types

type Token

type Token struct {
	AccessToken  string
	TokenType    string
	ExpiresIn    int
	RefreshToken string
}

Jump to

Keyboard shortcuts

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