This should return forbidden only when the query can't find the tenant or the authentication is wrong. Otherwise, the error message should be different and an internal or unavailable error should be returned. This can happen when the database query returns an error (e.g. due to it being unavailable).
as this needs to be checked for a NotFound error, and then it should return a forbidden error if something is off with the jwt, and in all other cases a generic error with a 500 status code
This should return forbidden only when the query can't find the tenant or the authentication is wrong. Otherwise, the error message should be different and an internal or unavailable error should be returned. This can happen when the database query returns an error (e.g. due to it being unavailable).
https://github.com/hatchet-dev/hatchet/blob/78685d0098123178f600b646ae21bd47bc138802/internal/services/grpc/middleware/auth.go#L37-L51
An important part is this line
https://github.com/hatchet-dev/hatchet/blob/73adb7791eba9a923c6d7735d2fc93df7c0c8d32/internal/auth/token/token.go#L145
as this needs to be checked for a NotFound error, and then it should return a forbidden error if something is off with the jwt, and in all other cases a generic error with a 500 status code