 DocumentStoreAuthorizationDialog = React.createFactory React.createClass
   displayName: 'DocumentStoreAuthorizationDialog'
 
+  getInitialState: ->
+    docStoreAvailable: false
+
+  componentWillMount: ->
+    @props.provider._onDocStoreLoaded =>
+      @setState docStoreAvailable: true
+
   authenticate: ->
     @props.provider.authorize()
 
   render: ->
     (div {},
-      (button {onClick: @authenticate}, 'Authorization Needed')
+      if @state.docStoreAvailable
+        (button {onClick: @authenticate}, 'Authorization Needed')
+      else
+        'Trying to log into the Document Store...'
     )
 
 class DocumentStoreProvider extends ProviderInterface

      xhrFields:
        withCredentials: true
      success: (data) ->
        provider._loginSuccessful(data)
      error: ->
        # nothing yet

  _loginWindow: null


            @_loginWindow.close()
            @_checkLogin()
        catch e
          # console.log e

      poll = setInterval pollAction, 200

