         chrome.storage.sync.set userData, ->
           userData['grid-user'] = user
           out.send userData
-          do callback
+          cleanUpUrl callback
         return
 
       for key, val of userData


      userData['grid-user'] = user
      out.send userData
      do callback

  c

      callback null, event.target.result
    fileReader.readAsDataURL req.response
  req.send()

cleanUpUrl = (callback) ->
  regex = new RegExp "(?:\\/)?\\?code=[A-Za-z0-9]+"
  newLoc = window.location.href.replace regex, ''
  if newLoc isnt window.location.href
    window.location.href = newLoc
  do callback
  return

exports.getComponent = ->
  c = new noflo.Component
