Fastapi: how to implement logout and refresh token

Created on 26 Sep 2020  路  3Comments  路  Source: tiangolo/fastapi

I am new to backend development I searched a lot for how to Implement logout but didn't find the way

question

Most helpful comment

Yeah, with the suggested way from @Yeganloo the token would be still valid. if you want to make a real logout you have to create a token blacklist and check in your auth dependency if the token has been revoked.

All 3 comments

When you use JWT, Logout have to be implement in front-end and fast-api has nothing to do with it.
Implement your refresh token in an put API.

so is it okay if u logged out u can still use ur token?

Yeah, with the suggested way from @Yeganloo the token would be still valid. if you want to make a real logout you have to create a token blacklist and check in your auth dependency if the token has been revoked.

Was this page helpful?
0 / 5 - 0 ratings