You can use
@EventListener
public void onPreAuthenticationCheckEvent(PreAuthenticationCheckEvent event) {
////////////
}
It is not in documentation but one of the forum post by @krivopustov mentioned it.
https://forum.jmix.io/t/more-missing-changed-undocumented-functionality-login-events/797/2
It is working.