mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 21:11:14 +00:00
c7de823c78
SessionRenewalInterceptor took req.user as proof that the trek_session cookie had been verified. On a route with its own guard chain that does not hold: ApiTokenGuard authenticates a public API key and sets req.user, and the cookie sent beside it is never checked. Past half its lifetime such a cookie was decoded without its signature and renewed, so a holder of a read-only key could come away with a signed session of the key's owner. The interceptor now runs the cookie through the guards' own check (signature, expiry, password version, active session) before it renews, requires it to name the request's user, and renews nothing on a request a public API key authenticated.