Jmix sample login restriction project

The sample login restriction project as available in cuba is upgraded to jmix? I want to implement concurrent user login my jmix project.

Please advice?

You can use Authentication Events to implement your login restrictions.

Thanks @krivopustov for reply.

My requirement is that if user enter same login details then he will be shown a dialog to abort existing session.

I am using onPreAuthenticationCheckEvent for raising the exception - It is working.
Then i am aborting session by sessionRegistry. - not working

My code is

for (SessionInformation information : sessionRegistry.getAllSessions(userDetails, true)) {
if (!information.isExpired()) information.expireNow();

Second login is successful now but first user if refresh browser, he can also access app. Please advice.