FastAPI auth feels easy until you test the failure cases
Building signup/login in FastAPI is not that hard.
The harder part is testing the cases people usually skip:
wrong password
duplicate email
expired access token
refresh token reuse
protected route without token
user accessing another user’s resource
deleted user still holding a token
The last one is especially easy to miss.
Your endpoint might verify the JWT is valid, but if the user was deleted / disabled / banned, the route still needs to reject them.
I think auth tests are where beginner FastAPI projects start becoming real backend projects.
What auth edge case do you think gets missed the most?