Remove un-used route

This commit is contained in:
2025-01-12 00:42:30 -06:00
parent 3e6b5d87b8
commit 04516e4e19

View File

@@ -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")
})