             @_loginWindow.close()
             @_checkLogin()
         catch e
-          console.log e
+          # console.log e
 
       poll = setInterval pollAction, 200
 

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

  _loginWindow: null


DocumentStoreAuthorizationDialog = React.createFactory React.createClass
  displayName: 'DocumentStoreAuthorizationDialog'

  getInitialState: ->
    docStoreAvailable: false

  componentWillMount: ->
    @props.provider._onDocStoreLoaded =>
      @setState docStoreAvailable: true

  authenticate: ->
    @props.provider.authorize()

  render: ->
    (div {},
      if @state.docStoreAvailable
        (button {onClick: @authenticate}, 'Authorization Needed')
      else
        'Trying to log into the Document Store...'
    )

class DocumentStoreProvider extends ProviderInterface
