Immutable solution version
π Bug Report: JWT still valid after Session Timeout
Complete solution
Shows how to fix π Bug Report: JWT still valid after Session Timeout. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
When it applies
Not specified by the original author.
Instructions
TL;DR
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.
Steps
- 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.
- 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.
When to use
You are seeing this: Verified against the closed issue and the maintainer/accepted answer there. Use this skill when you run into "π Bug Report: JWT still valid after Session Timeout".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
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
Sources
- https://github.com/appwrite/appwrite/issues/8000
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 2 Β· Exact version
Maintainer review
Checking maintainer review for this exact versionβ¦
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
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>