   singletons      : {}
   subscriptions   : []
   classes         : {}
-
-  apiUri: KD.config.apiUri
-  appsUri: KD.config.appsUri
+  apiUri          : KD.config.apiUri
+  appsUri         : KD.config.appsUri
 
   whoami:-> KD.getSingleton('mainController').userAccount
-  
+
   isLoggedIn:-> @whoami() instanceof KD.remote.api.JAccount
-  
+
   isMine:(account)-> @whoami().profile.nickname is account.profile.nickname
 
   checkFlag:(flag, account = KD.whoami())-> account.globalFlags and flag in account.globalFlags
 
-  setAuthKey:->
+  requireLogin:(errMsg, callback)->
 
-  requireLogin:(errMsg, callback)->
     [callback, errMsg] = [errMsg, callback] unless callback
+
     if KD.whoami() instanceof KD.remote.api.JGuest
       # KDView::handleEvent {type:"NavigationTrigger",pageName:"Login", appId:"Login"}
       new KDNotificationView


  socketConnected:()->
    @backendIsConnected = yes
    @propagateEvent "KDBackendConnectedEvent"

  setApplicationPartials:(partials)->
    @appPartials = partials

  subscribe : (subscription)->
    # unless subscription.KDEventType.toLowerCase() is "resize"
    @subscriptions.push subscription

# FIXME: very wasteful way to remove subscriptions, vs. splice ??
  removeSubscriptions : (aKDViewInstance) ->
    newSubscriptions = for subscription,i in @subscriptions
      subscription if subscription.subscribingInstance isnt aKDViewInstance

      else
        error "KD.singletons[\"#{singletonName}\"] singleton exists! if you want to override set override param to true]"
        KD.singletons[singletonName]
      KDObject.emit "singleton.#{singletonName}.registered"
    else
      # log "singleton registered! KD.singletons[\"#{singletonName}\"]"
      KD.singletons[singletonName] = object
