Fix local authentication bug

* In the local authentication function, check that the viewer is authenticated,
  not just that a viewer is present.