1
0

feat(api tokens): check for expiry date

This commit is contained in:
kolaente
2023-08-31 21:40:43 +02:00
parent fb2a1c59db
commit 677bd5cfc9

View File

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