Limit user to login when local

I have a user number 2 that I want to allow controlling lights with home-assistant.
But I don’t want that user to be able to do this when not at the location.
How can I limit this?

I found a topic about it, but no solution.