Merge Steven's new auth logic and fix E2E tests