Fixed invalid use of $this within match closures.

This issue had been fixed before, but appears to have been overwritten with other updates.

This PR fixes the use of `$this` within the match closures, but it did require making `loginCallback()` public, which may get someone into trouble if they attempt to call it directly.