Set maximum amount of instances authenticated at the same time for different users (Electron desktop app)

I want to integrate okta authentication module in my Electron js application and I’m looking for the solution.
I want to set maximum amount of instances running at a time for a certain user. So for example user #1 should be able to log in only one time until he logs out again. So one user can not run an app on different machines at the same time. How can I solve it?
Thank you!