authentication seems to be done in background.js

when I put the authentication code in popup.js, it does not work as I
expected.