diff --git a/http/http.go b/http/http.go index f6f284f..8699c8e 100644 --- a/http/http.go +++ b/http/http.go @@ -38,17 +38,6 @@ func (h *Handler) Serve() { api.GET("/login", func(c *gin.Context) { c.Redirect(http.StatusPermanentRedirect, "/login") }) api.POST("/login", h.loginPost) api.POST("/register", h.registerPost) - - // Unauthenticated routes - api.GET("/check", func(c *gin.Context) { c.String(http.StatusOK, "Accessible") }) - api.GET("/hello", func(c *gin.Context) { c.String(http.StatusOK, "Hello, World!") }) - - // Restricted group - r := api.Group("/restricted") - { - //r.Use(middleware.JWT([]byte(secret))) - r.GET("", h.restricted) - } } router.Run(":1323") @@ -68,17 +57,6 @@ func (h *Handler) dashboard(c *gin.Context) { c.HTML(http.StatusOK, "dashboard", d) } -func (h *Handler) restricted(c *gin.Context) { - token, err := h.verifyLogin(c) - if err != nil { - c.Redirect(http.StatusTemporaryRedirect, "/login") - return - } - - name := token.GetName() - c.String(http.StatusOK, "Welcome "+name+"!") -} - func (h *Handler) verifyLogin(c *gin.Context) (budgeteer.Token, error) { tokenString, err := c.Cookie(authCookie) if err != nil {