Comment

Comment by martinald

The problem I've got with JWTs is that actually you can rarely (never, really in my experience?) assume anything in the JWT apart from user id are valid for a long period of time.

For the most simple use case of an client auth state; you want to be able to revoke auth straight away if an account is compromised. This means you have to check the auth database for every request anyway, and you probably could have got whatever else was in the claim there quickly.

Same with roles; if you downgrade an admin user to a lower 'class' of user then you don't want it to take minutes to take effect.

So then all you are left with is a unified client id format, which is somewhat useful, but not really the 'promise' of JWTs (I feel?).

parent martinald 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton