TCatshoek / fastapi-nextauth-jwt

FastAPI Dependency to decode nextauth generated JWTs, for use in projects that mix nextjs/nextauth and fastapi.
MIT License
115 stars 8 forks source link

replaced standard Exception with FastAPI HTTPException #11

Closed b0n3sh closed 3 months ago

b0n3sh commented 4 months ago

It would solve #10

(this is my first PR, sorry if I'm doing something wrong)

TCatshoek commented 3 months ago

Hi b0n3sh,

Thanks for your PR. You're doing fine, no worries!

I would prefer to handle this with a fastapi exception handler (like discussed here) to give a little bit more flexibility in how much information is sent to the client when something goes wrong. It would allow you to give full error information in dev mode for easier debugging, and only return "unauthorized" in prod.