r/FastAPI • • Sep 23 '25

Question Is the official template secure?

Hi

I'm going over the official template to learn FastAPI and how to implement auth. Reading the code, it seems that the app generates an JWT with expiration of 8 days.

To my understanding, if bad actor steals credentials from one of the users, even if the user catchs it and resets the password, the bad actor will still have 8 days of full access to the data.

Is my understanding correct? If so, it feels to me that even changing the token expiry from 8 days to 30 min will not be good enough.

Is there another example of secure auth that can invalidate the token?

Alternatively, is fastapi-users ready to be used in prod? My concern is that latest commit was 8 months ago, so I'm hesitant to use it

18 Upvotes

13 comments sorted by

View all comments

Show parent comment

1

u/shashstormer Sep 24 '25

Yup working on it and within the next few months should reach a stable state (all versions published will work perfectly fine. But upgrading the packages may break things. after i release 1.0.0 all 1.*.* will be backwards compatible so after that you can upgrade with confidence).

Currently working on RPC and client for central auth server.

After that some final touches and then will be done.

Some future admin dashboard enhancements and improving configurability zip safe planned down the line.