Files
ALPHA-TRAIN2/services/tiktak/server/auth/middleware.go
T
bobiqq c231be0094
build-and-push / detect (push) Successful in 7s
build-and-push / build (${{ fromJSON(needs.detect.outputs.services) }}) (push) Failing after 3m33s
services
2026-08-26 11:04:23 +03:00

17 lines
301 B
Go

package auth
import (
"github.com/labstack/echo"
"net/http"
)
func RequiredMiddleware(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
ac := c.(*Context)
if ac == nil || ac.GetId() == 0 {
return c.Redirect(http.StatusFound, "/login")
}
return next(c)
}
}