Hi, an authentication must happen when the user is online, thats correct. So at first login, you always have to be online, but you can keep the session alive. Read following part of mendix docs. You will see, mendix has already some logic about that.
https://docs.mendix.com/refguide/mobile/introduction-to-mobile-technologies/progressive-web-app/#sessions
If you have any detailed questions, please tell me.