// Router returns a chi router instance with all core user
// routes. Bool parameter determines whether registration is allowed
// or not (useful for applications where users are invited rather
// than allowed to register themselves).
Router returns a chi router instance with all core user
routes. Bool parameter determines whether registration is allowed
or not (useful for applications where users are invited rather
than allowed to register themselves).
// Router returns a chi router instance with all core user // routes . Bool parameter determines whether registration is allowed // or not ( useful for applications where users are invited rather // than allowed to register themselves ) .
func (h *Handler) Router(open bool) chi.Router {
	r := h.BasicRouter(open)
	r.Group(func(sr chi.Router) {
		sr.Use(h.session.manager.Auth)
		sr.Get("/", h.Fetch)
		sr.Patch("/", h.Update)
		sr.Delete("/", h.Delete)
	})
	r.Route("/sessions", func(sr chi.Router) {
		sr.Use(h.session.manager.Auth)
		sr.Get("/", h.FetchSessions)
		sr.Delete("/{id}", h.RevokeSession)
		sr.Delete("/", h.RevokeOtherSessions)
	})
	r.Route("/activation", func(sr chi.Router) {
		sr.With(h.session.manager.Auth).Put("/", h.ResendVerification)
		sr.Get("/", h.Verify)
		sr.Get("/cancel", h.CancelVerification)
	})
	r.Route("/verification", func(sr chi.Router) {
		sr.With(h.session.manager.Auth).Put("/", h.ResendVerification)
		sr.Get("/", h.Verify)
		sr.Get("/cancel", h.CancelVerification)
	})
	r.Route("/recovery", func(sr chi.Router) {
		sr.Put("/", h.InitRecovery)
		sr.Post("/", h.Recover)
		sr.Get("/", h.PingRecovery)
		sr.Get("/cancel", h.CancelRecovery)
	})
	r.NotFound(httpflow.NotFound(h.log))
	r.MethodNotAllowed(httpflow.MethodNotAllowed(h.log))
	return r
}
func ( h * Handler ) Router ( open bool ) chi . Router { r := h . BasicRouter ( open ) r . Group ( func ( sr chi . Router ) { sr . Use ( h . session . manager . Auth ) sr . Get ( " " , h . Fetch ) sr . Patch ( " " , h . Update ) sr . Delete ( " " , h . Delete ) } ) r . Route ( " " , func ( sr chi . Router ) { sr . Use ( h . session . manager . Auth ) sr . Get ( " " , h . FetchSessions ) sr . Delete ( " " , h . RevokeSession ) sr . Delete ( " " , h . RevokeOtherSessions ) } ) r . Route ( " " , func ( sr chi . Router ) { sr . With ( h . session . manager . Auth ) . Put ( " " , h . ResendVerification ) sr . Get ( " " , h . Verify ) sr . Get ( " " , h . CancelVerification ) } ) r . Route ( " " , func ( sr chi . Router ) { sr . With ( h . session . manager . Auth ) . Put ( " " , h . ResendVerification ) sr . Get ( " " , h . Verify ) sr . Get ( " " , h . CancelVerification ) } ) r . Route ( " " , func ( sr chi . Router ) { sr . Put ( " " , h . InitRecovery ) sr . Post ( " " , h . Recover ) sr . Get ( " " , h . PingRecovery ) sr . Get ( " " , h . CancelRecovery ) } ) r . NotFound ( httpflow . NotFound ( h . log ) ) r . MethodNotAllowed ( httpflow . MethodNotAllowed ( h . log ) ) return r }
Router returns a chi router instance with all core user
routes.
Router returns a chi router instance with all core user routes .