How to execute some code on logout in open platform 5.4

I want to execute arbitrary code on logout using open platform 5.4 (version 6.1 is not an option for me)

Sorry it’s impossible. You only have a PostLogin event in 5.4

LogoutEvent (which is not documented on the doc) is only available in Axelor 6.X.

I tried to add the line LogoutEvent(principals, AuthUtils.getUser())); to the onLogout method in the AuthPac4jListener and the corresponding logoutEvent POJO in the events folder and recompile the open platform, but unfortunately the onLogout method is not called when the user logs out!! any Idea on how to implement that in the 4.5 version