local

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Session = NewBrowserSession()

Session is a global variable that holds the current session

Functions

func AuthHandler

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

AuthHandler handle validating tokens and session cookies for local authentication

func ValidateSessionCookie

func ValidateSessionCookie(w http.ResponseWriter, r *http.Request) bool

Types

type BrowserSession

type BrowserSession struct {
	// contains filtered or unexported fields
}

BrowserSession is a struct that holds the session ID of the current session The session ID is generated once tokens are validated during local auth mode and is stored in a cookie

func NewBrowserSession

func NewBrowserSession() *BrowserSession

NewBrowserSession creates a new BrowserSession

func (*BrowserSession) Remove

func (s *BrowserSession) Remove()

func (*BrowserSession) Store

func (s *BrowserSession) Store(sessionID string)

func (*BrowserSession) Validate

func (s *BrowserSession) Validate(sessionID string) bool

Jump to

Keyboard shortcuts

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