strongloop/strong-registry — pull request #6 by bajtos (2014-04-25 09:36:39+00:00)
Title: Make credentials queries work with npm

Before this change, sl-registry would set `username` in the npm config
but would not provide `password`. This caused npm to complain about
missing credentials. Unfortunately the error message did not make it
clear how to solve the problem. See npm/npm-registry-client#44.

Even when the user figured out he has to run `npm login`, npm would
not ask for a new password, because the username was not being changed.
See npm/npm#5145.

This commits introduces two changes in sl-registry:

1. `sl-registry use` checks the config option `always-auth`.
If it is enabled and the npm config does not have all auth
credentials, `npm login` is executed to let the user authenticate.

2. `sl-registry add` does not ask for `username`. This way
`npm login` detects a new username and asks for a password.

/to @sam-github please review
/cc @cgole
/cc @crandmck Please update the docs after this patch is landed.