socialsessions

package
v0.0.0-...-c8d5bbb Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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) Get

func (self *SessionManager) Get(req *http.Request) (*sessions.Session, error)

func (*SessionManager) GetFacebookLoginHandlers

func (self *SessionManager) GetFacebookLoginHandlers(clientID, clientSecret, callbackUrl string) (http.Handler, http.Handler)

func (*SessionManager) GetGoogleLoginHandlers

func (self *SessionManager) GetGoogleLoginHandlers(clientID, clientSecret, callbackUrl string) (http.Handler, http.Handler)

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.

Jump to

Keyboard shortcuts

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