Simplify homepage: remove auth check, keep login hidden for now

This commit is contained in:
2026-01-23 17:56:29 -05:00
parent 327b1cc5a4
commit 7c89e9f214
2 changed files with 50 additions and 11 deletions
-11
View File
@@ -6,10 +6,8 @@ import (
"bytes"
"log"
"net/http"
"strings"
"github.com/go-playground/validator/v10"
jwtgo "github.com/golang-jwt/jwt"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)
@@ -40,16 +38,7 @@ func main() {
// Routes
e.GET("/", func(c echo.Context) error {
tokenString := getToken(c)
loggedIn := false
if tokenString != "" {
token, err := jwtgo.Parse(tokenString, func(token *jwtgo.Token) (interface{}, error) {
return []byte(cfg.JWTSecret), nil
})
if err == nil && token.Valid {
loggedIn = true
}
}
var buf bytes.Buffer
err := templates.Index(loggedIn).Render(c.Request().Context(), &buf)
if err != nil {