Fix authentication during db upgrade