Documentation ¶
Index ¶
- func GeneratePasswordHash(password string) (string, error)
- func ValidatePassword(password string, hashedPassword string) (bool, error)
- type Extension
- func (s *Extension) AddRoutes(app *nibbler.Application) error
- func (s *Extension) Destroy(app *nibbler.Application) error
- func (s *Extension) EmailTokenVerifyHandler(w http.ResponseWriter, r *http.Request)
- func (s *Extension) EnforceEmailValidated(routerFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
- func (s *Extension) EnforceLoggedIn(routerFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
- func (s *Extension) GetCurrentUserHandler(w http.ResponseWriter, r *http.Request)
- func (s *Extension) Init(app *nibbler.Application) error
- func (s *Extension) Login(email string, password string) (*nibbler.User, error)
- func (s *Extension) LoginFormHandler(w http.ResponseWriter, r *http.Request)
- func (s *Extension) LogoutHandler(w http.ResponseWriter, r *http.Request)
- func (s *Extension) RegisterFormHandler(w http.ResponseWriter, r *http.Request)
- func (s *Extension) ResetPasswordHandler(w http.ResponseWriter, r *http.Request)
- func (s *Extension) ResetPasswordTokenHandler(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePasswordHash ¶
Types ¶
type Extension ¶
type Extension struct { nibbler.Extension SessionExtension *session.Extension UserExtension *user.Extension // for emailing Sender nibbler.MailSender // for password reset PasswordResetEnabled bool PasswordResetFromName string PasswordResetFromEmail string PasswordResetRedirect string // a UI or other service to handle the redirect from email (will have ?token=X or &token=X appended) PasswordResetTokenExpirationDays *int // for email verification RegistrationEnabled bool EmailVerificationEnabled bool // whether email verification is available (doesn't mean it's required) EmailVerificationRequired bool // whether email verification is required before logging in EmailVerificationTokenExpirationDays *int EmailVerificationRedirect string EmailVerificationFromName string EmailVerificationFromEmail string // callbacks (for extending default behavior) OnLoginSuccessful *func(loggedInUser nibbler.User, sessionMaxAgeMinutes int) OnLogoutSuccessful *func(loggedOutUser nibbler.User) OnRegistrationSuccessful *func(registeredUser nibbler.User) OnEmailVerificationSuccessful *func(registeredUser nibbler.User) // contains filtered or unexported fields }
func (*Extension) EmailTokenVerifyHandler ¶ added in v0.3.4
func (s *Extension) EmailTokenVerifyHandler(w http.ResponseWriter, r *http.Request)
func (*Extension) EnforceEmailValidated ¶ added in v0.4.0
func (s *Extension) EnforceEmailValidated(routerFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
also validates the user is logged in
func (*Extension) EnforceLoggedIn ¶
func (s *Extension) EnforceLoggedIn(routerFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
func (*Extension) GetCurrentUserHandler ¶ added in v0.4.1
func (s *Extension) GetCurrentUserHandler(w http.ResponseWriter, r *http.Request)
func (*Extension) LoginFormHandler ¶
func (s *Extension) LoginFormHandler(w http.ResponseWriter, r *http.Request)
func (*Extension) LogoutHandler ¶
func (s *Extension) LogoutHandler(w http.ResponseWriter, r *http.Request)
func (*Extension) RegisterFormHandler ¶ added in v0.3.4
func (s *Extension) RegisterFormHandler(w http.ResponseWriter, r *http.Request)
TODO: allow username
func (*Extension) ResetPasswordHandler ¶
func (s *Extension) ResetPasswordHandler(w http.ResponseWriter, r *http.Request)
func (*Extension) ResetPasswordTokenHandler ¶
func (s *Extension) ResetPasswordTokenHandler(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.