From 04516e4e1902e0e2d39484c21216ed3fbd81421a Mon Sep 17 00:00:00 2001 From: William Gill Date: Sun, 12 Jan 2025 00:42:30 -0600 Subject: [PATCH] Remove un-used route --- service/webserver.go | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/service/webserver.go b/service/webserver.go index e7378c7..c82487f 100644 --- a/service/webserver.go +++ b/service/webserver.go @@ -122,38 +122,6 @@ func StartEcho(server chan bool, webserver_addr string, webserver_port int) { return c.String(http.StatusOK, "OK - "+printJob) }) - e.POST("/login", func(c echo.Context) error { - - username := c.FormValue("username") - password := c.FormValue("password") - - // Throws unauthorized error - if username != "test" || password != "login" { - return echo.ErrUnauthorized - } - - // Set custom claims - claims := &jwtCustomClaims{ - jwt.RegisteredClaims{ - ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Hour * 72)), - }, - } - - // Create token with claims - token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) - - // Generate encoded token and send it as response. - t, err := token.SignedString([]byte("secret")) - if err != nil { - return err - } - - return c.JSON(http.StatusOK, echo.Map{ - "token": t, - }) - - }).Name = "Login" - e.GET("/robots.txt", func(c echo.Context) error { return c.String(http.StatusOK, "User-agent: *\nDisallow:\n") })