feat(api tokens): check for expiry date
This commit is contained in:
parent
fb2a1c59db
commit
677bd5cfc9
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user