auth

package
v0.0.0-...-9d9a824 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ExpirationClaimKey = "exp"
View Source
const RefreshTokenTime = 3 * 24 * time.Hour

refresh token if it expires in 3 days

View Source
const UserIdClaimKey = "user_id"

Variables

View Source
var TokenAuth *jwtauth.JWTAuth

Functions

func ClearJwtCookie

func ClearJwtCookie(w http.ResponseWriter)

func GenerateTokenForUser

func GenerateTokenForUser(id users.UserId) (*jwt.Token, string, error)

func SetJwtCookie

func SetJwtCookie(tokenString string, w http.ResponseWriter)

func ShouldRefreshToken

func ShouldRefreshToken(exp time.Time) bool

should refresh if token will expire in refresh token time

Types

This section is empty.

Jump to

Keyboard shortcuts

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