fix(api): make sure permission to read all tasks work for reading all tasks per project
Resolves https://github.com/go-vikunja/api/issues/105
This commit is contained in:
@ -23,6 +23,7 @@ import (
|
||||
|
||||
"code.vikunja.io/api/pkg/config"
|
||||
"code.vikunja.io/api/pkg/db"
|
||||
"code.vikunja.io/api/pkg/log"
|
||||
"code.vikunja.io/api/pkg/models"
|
||||
|
||||
echojwt "github.com/labstack/echo-jwt/v4"
|
||||
@ -66,6 +67,7 @@ func checkAPITokenAndPutItInContext(tokenHeaderValue string, c echo.Context) err
|
||||
}
|
||||
|
||||
if time.Now().After(token.ExpiresAt) {
|
||||
log.Debugf("[auth] Tried authenticating with token %d but it expired on %s", token.ID, token.ExpiresAt.String())
|
||||
return echo.NewHTTPError(http.StatusUnauthorized)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user