No, you should have an implementation of the loginRequired callback handler as described here, but the function onLoginRequired() itself is not necessary.
No, you should have an implementation of the loginRequired callback handler as described here, but the function onLoginRequired() itself is not necessary.