auth route group

This commit is contained in:
Umputun
2017-12-28 21:25:20 -06:00
parent d3e380b154
commit df6a0b0593
+6 -3
View File
@@ -63,9 +63,12 @@ func (s *Server) Run() {
// If you aren't using gorilla/mux, you need to wrap your handlers with context.ClearHandler
router.Use(context.ClearHandler)
router.Mount("/auth/google", s.AuthGoogle.Routes())
router.Mount("/auth/github", s.AuthGithub.Routes())
router.Mount("/auth/facebook", s.AuthFacebook.Routes())
router.Route("/auth", func(r chi.Router) {
r.Mount("/google", s.AuthGoogle.Routes())
r.Mount("/github", s.AuthGithub.Routes())
r.Mount("/facebook", s.AuthFacebook.Routes())
r.Get("/logout", s.AuthGoogle.LogoutHandler) // shortcut, can be any of providers, does the same
})
router.Route("/api/v1", func(rapi chi.Router) {
rapi.Get("/find", s.findCommentsCtrl)