expire

package
v2.4.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package expire helps expire user's logged in sessions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(ab *authboss.Authboss) func(http.Handler) http.Handler

Middleware ensures that the user's expiry information is kept up-to-date on each request. Deletes the SessionKey from the session if the user is expired (a.ExpireAfter duration since SessionLastAction). This middleware conflicts with use of the Remember module, don't enable both at the same time.

func RefreshExpiry

func RefreshExpiry(w http.ResponseWriter, r *http.Request)

RefreshExpiry updates the last action for the user, so he doesn't become expired.

func Setup

func Setup(ab *authboss.Authboss) error

Setup the expire module

This installs a hook into the login process so that the LastAction is recorded immediately.

func TimeToExpiry

func TimeToExpiry(r *http.Request, expireAfter time.Duration) time.Duration

TimeToExpiry returns zero if the user session is expired else the time until expiry. Takes in the allowed idle duration.

Types

This section is empty.

Jump to

Keyboard shortcuts

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