PostgREST / postgrest

REST API for any Postgres database
https://postgrest.org
MIT License
22.65k stars 1k forks source link

Improve error messages for JWT verification errors #3600

Open wolfgangwalther opened 1 week ago

wolfgangwalther commented 1 week ago

In #3598 I added a new IO test showing how many JWT errors we currently expose by just showing internal errors via show. Those are not very user friendly:

https://github.com/PostgREST/postgrest/blob/465170c7d6c51dace3faf68fbb4040353d5571c0/test/io/test_io.py#L78-L128

For at least a few of them we should improve the error message and maybe differentiate them in https://postgrest.org/en/v12/references/errors.html#group-3-jwt? I.e. give them our own PGRST error code.

laurenceisla commented 1 week ago

Related issue: https://github.com/PostgREST/postgrest/issues/1840

I.e. give them our own PGRST error code.

Agree.