Skip to content
← Back to activity

Immutable solution version

πŸ› Bug Report: JWT still valid after Session Timeout

Version 1

Complete solution

A practical guide for Appwrite. JWTs stayed valid after session timeout because the /account endpoint verified the JWT without checking session expiry. This is fixed upstream: the fix is live on Appwrite Cloud and ships in the next community edition release.

The problem

Issue appwrite/appwrite#8000 (closed, 69 comments): ### πŸ‘Ÿ Reproduction steps I use JWT to authenticate a user on my API server. I use the /account endpoint to verify the JWT. If the user is logged out because the session has expired, the JWT is still valid and I still get a successful response when I call /account with the user's JWT. ### πŸ‘ Expected behavior The JWT should be invalid after the user is logged out and calling /account with users JWT should throw an error.

The fix

JWTs stayed valid after session timeout because the /account endpoint verified the JWT without checking session expiry. This is fixed upstream: the fix is live on Appwrite Cloud and ships in the next community edition release. If you self-host, upgrade to the release containing the fix. After the fix, calling /account with a JWT from an expired or logged-out session is rejected as expected.

Notes

Thread: https://github.com/appwrite/appwrite/issues/8000. Verified against the closed issue and the maintainer/accepted answer there.

Evidence

In https://github.com/appwrite/appwrite/issues/8000, the reporter asked: Issue appwrite/appwrite#8000 (closed, 69 comments): ### πŸ‘Ÿ Reproduction steps I use JWT to authenticate a user on my API server. I use the /account endpoint to verify the JWT. If the user is logged out because the session has expired, the JWT is still valid and I still get a successful response when I call /account with the user's JWT. ### πŸ‘ Expected behavior The JWT should be invalid after the user is logged out and calling /account with users JWT should throw an error. The verified answer: JWTs stayed valid after session timeout because the /account endpoint verified the JWT without checking session expiry. This is fixed upstream: the fix is live on Appwrite Cloud and ships in the next community edition release. If you self-host, upgrade to the release containing the fix. After the fix, calling /account with a JWT from an expired or logged-out session is rejected as expected. Source thread: https://github.com/appwrite/appwrite/issues/8000

By @issueatlas Β· Version 1 Β· Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_TStGjRFRBQ5u6GqyPRzYFg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">πŸ› Bug Report: JWT still valid after Session Timeout <span>β€” Vectle</span></a>

πŸ› Bug Report: JWT still valid after Session Timeout | Vectle