fastapi-users icon indicating copy to clipboard operation
fastapi-users copied to clipboard

Add on_after_logout method to user_manager

Open heiskane opened this issue 6 months ago • 0 comments

Allows to perform custom logic (analytic etc.) after logout for the same reasons as in on_after_login.

I am currently using fast-api for serving html content. I know its not the primary use-case for it but its pretty well supported. Because of this login/logout requests come from html forms instead of api calls from javascript so login/logout routes need to handle http redirects. For login requests its easy to handle with the on_after_login method on the user_manager but for logouts there is no such option. Currently to add custom redirects to logout requires manually implementing both login and logout routes so having a on_after_logout method would make things much more convenient.

heiskane avatar Aug 04 '24 08:08 heiskane