Documentation ¶
Index ¶
- Constants
- func GetLoggedInUserID(r *http.Request, w http.ResponseWriter) (string, bool)
- func GetRedirectData(r *http.Request, w http.ResponseWriter) url.Values
- func GetReturnURI(r *http.Request, w http.ResponseWriter, fallbackURI string) string
- func IsLoggedIn(r *http.Request, w http.ResponseWriter) bool
- func Logout(r *http.Request, w http.ResponseWriter) error
- func StoreCurrentURI(r *http.Request, w http.ResponseWriter) error
- func StoreLoggedInUserID(r *http.Request, w http.ResponseWriter, userID string) error
- func StoreRedirectData(r *http.Request, w http.ResponseWriter) error
- func StoreReturnURI(r *http.Request, w http.ResponseWriter, returnURI string) error
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 ¶
GetLoggedInUserID gets the logged in user ID from the session.
func GetRedirectData ¶
GetRedirectData gets the redirect URI from the session with request payload.
func GetReturnURI ¶
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 ¶
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 ¶
StoreReturnURI stores the return URI in the session.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.