Add missing error handling in checkAuth