Fixed json login after refactoring.