Documentation ¶
Index ¶
- type SessionManager
- func (self *SessionManager) DestroySession(w http.ResponseWriter)
- func (self *SessionManager) Get(req *http.Request) (*sessions.Session, error)
- func (self *SessionManager) GetFacebookLoginHandlers(clientID, clientSecret, callbackUrl string) (http.Handler, http.Handler)
- func (self *SessionManager) GetGitHubLoginHandlers(clientID, clientSecret, callbackUrl string) (http.Handler, http.Handler)
- func (self *SessionManager) GetGoogleLoginHandlers(clientID, clientSecret, callbackUrl string) (http.Handler, http.Handler)
- func (self *SessionManager) IsAuthenticated(req *http.Request) bool
- func (self *SessionManager) IssueSession() *sessions.Session
- func (self *SessionManager) LogoutHandler(w http.ResponseWriter, req *http.Request)
- func (self *SessionManager) RequireLogin(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
func New ¶
func New(sessionName, sessionSecret string) *SessionManager
func (*SessionManager) DestroySession ¶
func (self *SessionManager) DestroySession(w http.ResponseWriter)
func (*SessionManager) GetFacebookLoginHandlers ¶
func (*SessionManager) GetGitHubLoginHandlers ¶
func (*SessionManager) GetGoogleLoginHandlers ¶
func (*SessionManager) IsAuthenticated ¶
func (self *SessionManager) IsAuthenticated(req *http.Request) bool
isAuthenticated returns true if the user has a signed session cookie.
func (*SessionManager) IssueSession ¶
func (self *SessionManager) IssueSession() *sessions.Session
func (*SessionManager) LogoutHandler ¶
func (self *SessionManager) LogoutHandler(w http.ResponseWriter, req *http.Request)
logoutHandler destroys the session on POSTs and redirects to home.
func (*SessionManager) RequireLogin ¶
func (self *SessionManager) RequireLogin(next http.Handler) http.Handler
requireLogin redirects unauthenticated users to the login route.
Click to show internal directories.
Click to hide internal directories.