     window.addEventListener('message', (e) => @receiveMessage(e))
 
   signOut: ->
-    console.log('auth.signOut')
     Travis.storage.removeItem('travis.locale')
     Travis.storage.removeItem('travis.user')
     Travis.storage.removeItem('travis.token')

    @set('user', undefined)

  signIn: ->
    console.log('auth.signIn')
    @set('state', 'signing-in')
    url = "#{@endpoint}/auth/post_message?origin=#{@receivingEnd}"
    $('<iframe id="auth-frame" />').hide().appendTo('body').attr('src', url)

  autoSignIn: ->
    console.log('auth.autoSignIn')
    data = @userDataFrom(Travis.sessionStorage) || @userDataFrom(Travis.storage)
    @setData(data) if data


    path

  receiveMessage: (event) ->
    if event.origin == @expectedOrigin()
      if event.data == 'redirect'
        window.location = "#{@endpoint}/auth/handshake?redirect_uri=#{location}"
