session

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReturnURIKey is the key used to store the return URI in the session.
	ReturnURIKey = "return_uri"
	// RedirectDataKey is the key used to store the redirect URI in the session.
	RedirectDataKey = "redirect_data"
	// LoggedInUserIDKey is the key used to store the logged in user ID in the session.
	LoggedInUserIDKey = "logged_in_user_id"
)

Variables

This section is empty.

Functions

func GetLoggedInUserID

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

GetLoggedInUserID gets the logged in user ID from the session.

func GetRedirectData

func GetRedirectData(r *http.Request, w http.ResponseWriter) url.Values

GetRedirectData gets the redirect URI from the session with request payload.

func GetReturnURI

func GetReturnURI(r *http.Request, w http.ResponseWriter, fallbackURI string) string

GetReturnURI gets the return URI from the session.

func IsLoggedIn

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

IsLoggedIn checks if the user is logged in.

func Logout added in v0.1.9

func Logout(r *http.Request, w http.ResponseWriter) error

Logout logs the user out.

func StoreCurrentURI

func StoreCurrentURI(r *http.Request, w http.ResponseWriter) error

StoreCurrentURI stores the current URI in the session as the return URI.

func StoreLoggedInUserID

func StoreLoggedInUserID(r *http.Request, w http.ResponseWriter, userID string) error

StoreLoggedInUserID stores the logged in user ID in the session.

func StoreRedirectData

func StoreRedirectData(r *http.Request, w http.ResponseWriter) error

StoreRedirectData stores the redirect URI in the session with request payload.

func StoreReturnURI

func StoreReturnURI(r *http.Request, w http.ResponseWriter, returnURI string) error

StoreReturnURI stores the return URI in the session.

Types

This section is empty.

Jump to

Keyboard shortcuts

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