Simplifying code for authenticating automatically or with LocalAuthentication.