Improved checkAuth, added logon-helper for tests