diff --git a/pkg/routes/routes.go b/pkg/routes/routes.go index 4350d17ab..0c84e73f9 100644 --- a/pkg/routes/routes.go +++ b/pkg/routes/routes.go @@ -312,6 +312,10 @@ func registerAPIRoutes(a *echo.Group) { return echo.NewHTTPError(http.StatusInternalServerError).SetInternal(err) } + if token.ExpiresAt.After(time.Now()) { + return echo.NewHTTPError(http.StatusUnauthorized) + } + c.Set("api_token", token) return next(c)