Protecting our routes with auth middleware
This commit is contained in:
@ -37,5 +37,10 @@ func routes(app *config.AppConfig) http.Handler {
|
||||
fileServer := http.FileServer(http.Dir("./static/"))
|
||||
mux.Handle("/static/*", http.StripPrefix("/static", fileServer))
|
||||
|
||||
mux.Route("/admin", func(mux chi.Router) {
|
||||
mux.Use(Auth)
|
||||
mux.Get("/dashboard", handlers.Repo.AdminDashboard)
|
||||
})
|
||||
|
||||
return mux
|
||||
}
|
||||
|
Reference in New Issue
Block a user