I don't know if it is in any way secured so please do some research before.
But the fact is that npm
is storing all those informations into a file. If you look at:
cat ~/.npmrc
It could be interesting enough so you could do the login dance only once.