We're using a VPN to access certain parts of internal infrastructure from the office; the VPN uses 2FA, so saving credentials and bringing it up with the network when the machine wakes up is not an option.
People take their Macbooks to meetings, and when they do they
- lose power (battery mode)
- close the lid
That combination causes the Mac to shut down WiFi, which subsequently frequently tears down the VPN connection (it survives when there's no TLS handshake while the interface is down). Is there a way to stop the Mac from going to sleep (turn off WiFi) when the lid gets closed?