Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultCookieName = "usid" DefaultExpiresIn = time.Hour * 12 )
Functions ¶
func New ¶
func New[T any](pool *pgxpool.Pool, opts ...func(*Config)) shieldstrategy.Authenticator[T]
New creates a new session authenticator.
The sesion authenticator uses a DB to store sessions and a cookie to store the session ID.
Types ¶
type LogoutHandler ¶
type LogoutHandler struct {
// contains filtered or unexported fields
}
LogoutHandler is a handler that logs out the user and deletes the session.
func NewLogoutHandler ¶
func NewLogoutHandler(pool *pgxpool.Pool, config *Config) *LogoutHandler
func (*LogoutHandler) HandleLogout ¶
func (h *LogoutHandler) HandleLogout(w http.ResponseWriter, r *http.Request) error
Click to show internal directories.
Click to hide internal directories.