Documentation
¶
Index ¶
- func WithCookieDomain(domain string) func(*UserHttpHandler)
- func WithSecureCookie(secure bool) func(*UserHttpHandler)
- type User
- type UserHttpHandler
- func (h *UserHttpHandler) ConfirmEmailVerification(w http.ResponseWriter, r *http.Request)
- func (h *UserHttpHandler) ConfirmPasswordReset(w http.ResponseWriter, r *http.Request)
- func (httpserver *UserHttpHandler) GetRole(w http.ResponseWriter, r *http.Request)
- func (httpserver *UserHttpHandler) Login(w http.ResponseWriter, r *http.Request)
- func (httpserver *UserHttpHandler) Logout(w http.ResponseWriter, r *http.Request)
- func (httpserver *UserHttpHandler) Register(w http.ResponseWriter, r *http.Request)
- func (h *UserHttpHandler) RegisterRoutes(r *chi.Mux)
- func (h *UserHttpHandler) RequestEmailVerification(w http.ResponseWriter, r *http.Request)
- func (h *UserHttpHandler) RequestPasswordReset(w http.ResponseWriter, r *http.Request)
- func (h *UserHttpHandler) WhoAmI(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCookieDomain ¶
func WithCookieDomain(domain string) func(*UserHttpHandler)
WithCookieDomain sets the cookie domain for the UserHttpHandler
func WithSecureCookie ¶
func WithSecureCookie(secure bool) func(*UserHttpHandler)
Types ¶
type UserHttpHandler ¶
type UserHttpHandler struct {
// contains filtered or unexported fields
}
func NewUserHttpHandler ¶
func NewUserHttpHandler(userSrvc user.UserService, jwtKey []byte, options ...func(*UserHttpHandler)) *UserHttpHandler
NewUserHttpHandler creates a new UserHttpHandler with the given user service and JWT key. The cookieDomain parameter is optional and defaults to an empty string if not provided.
func (*UserHttpHandler) ConfirmEmailVerification ¶ added in v1.1.0
func (h *UserHttpHandler) ConfirmEmailVerification(w http.ResponseWriter, r *http.Request)
func (*UserHttpHandler) ConfirmPasswordReset ¶ added in v1.1.0
func (h *UserHttpHandler) ConfirmPasswordReset(w http.ResponseWriter, r *http.Request)
func (*UserHttpHandler) GetRole ¶
func (httpserver *UserHttpHandler) GetRole(w http.ResponseWriter, r *http.Request)
GetRole returns the role of the currently logged-in user
func (*UserHttpHandler) Login ¶
func (httpserver *UserHttpHandler) Login(w http.ResponseWriter, r *http.Request)
func (*UserHttpHandler) Logout ¶
func (httpserver *UserHttpHandler) Logout(w http.ResponseWriter, r *http.Request)
Logout handles user logout by clearing the auth_token cookie
func (*UserHttpHandler) Register ¶
func (httpserver *UserHttpHandler) Register(w http.ResponseWriter, r *http.Request)
func (*UserHttpHandler) RegisterRoutes ¶
func (h *UserHttpHandler) RegisterRoutes(r *chi.Mux)
func (*UserHttpHandler) RequestEmailVerification ¶ added in v1.1.0
func (h *UserHttpHandler) RequestEmailVerification(w http.ResponseWriter, r *http.Request)
func (*UserHttpHandler) RequestPasswordReset ¶ added in v1.1.0
func (h *UserHttpHandler) RequestPasswordReset(w http.ResponseWriter, r *http.Request)
func (*UserHttpHandler) WhoAmI ¶
func (h *UserHttpHandler) WhoAmI(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.