function tryToLogin() {
        if (!$scope.vpnEnabled) {
            return Promise.resolve();
        }

        /**
         * If there exists addresses, use the first one. This is make sure we are testing
         * the correct credentials for a sub-user with a custom domain with VPN.
         * If no addresses exist, assume it doesn't have a custom domain.
         */
        const Username = addresses.length ? addresses[0].Email : user.Name;

        return authentication.loginWithCredentials({
            Username,
            Password: passwordCopy
        });
    }
/**
     * Try to login for ProtonVPN user to detect if the password entered is correct
     * @return {Promise}
     */
Try to login for ProtonVPN user to detect if the password entered is correct
@return {Promise}
Try to login for ProtonVPN user to detect if the password entered is correct @return { Promise }
function tryToLogin() {
        if (!$scope.vpnEnabled) {
            return Promise.resolve();
        }
        const Username = addresses.length ? addresses[0].Email : user.Name;
        return authentication.loginWithCredentials({
            Username,
            Password: passwordCopy
        });
    }
function tryToLogin ( ) { if ( ! $scope . vpnEnabled ) { return Promise . resolve ( ) ; } const Username = addresses . length ? addresses [ 0 ] . Email : user . Name ; return authentication . loginWithCredentials ( { Username , Password : passwordCopy } ) ; }
Try to login for ProtonVPN user to detect if the password entered is correct
 @return {Promise}
Try to login for ProtonVPN user to detect if the password entered is correct @return { Promise }
/**
         * If there exists addresses, use the first one. This is make sure we are testing
         * the correct credentials for a sub-user with a custom domain with VPN.
         * If no addresses exist, assume it doesn't have a custom domain.
         */