npm-profile
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -70,2 +70,6 @@ 'use strict' | ||
const target = url.resolve(conf.registry, '-/npm/v1/user') | ||
profile.forEach(key => { | ||
// profile keys can't be empty strings, but they CAN be null | ||
if (profile[key] === '') profile[key] = null | ||
}) | ||
return fetchJSON(Object.assign({target: target, method: 'POST', body: profile}, conf)) | ||
@@ -72,0 +76,0 @@ } |
{ | ||
"name": "npm-profile", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Library for updating an npmjs.com profile", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -210,6 +210,8 @@ # npm-profile | ||
2. `profile.set({tfa: {password, mode}}, {registry, auth: {token}})` | ||
* Note that the user's `password` is required here in the `tfa` object, regardless of auth. | ||
* `mode` is either `auth-only` which requires `otp` when calling `login` | ||
* Note that the user's `password` is required here in the `tfa` object, | ||
regardless of how you're authenticating. | ||
* `mode` is either `auth-only` which requires an `otp` when calling `login` | ||
or `createToken`, or `mode` is `auth-and-writes` and an `otp` will be | ||
required when publishing. | ||
required on login, publishing or when granting others access to your | ||
modules. | ||
* Be aware that this set call may require otp as part of the auth object. | ||
@@ -219,13 +221,13 @@ If otp is needed it will be indicated through a rejection in the usual | ||
3. If tfa was already enabled then you're just switch modes and a | ||
successful response means that you're done. If the tfa property is empty and | ||
tfa _wasn't_ enabled then it means they were in a pending state. | ||
successful response means that you're done. If the tfa property is empty | ||
and tfa _wasn't_ enabled then it means they were in a pending state. | ||
3. The response will have a `tfa` property set to an `otpauth` URL, as | ||
[used by Google Authenticator](https://github.com/google/google-authenticator/wiki/Key-Uri-Format). | ||
You will need to show this to the user for them to add to their | ||
authenticator application. This is typically done as a QRCODE, but you can | ||
also show the value of the `secret` key in the `otpauth` query string and | ||
they can type or copy paste that in. | ||
4. To complete setting up two factor auth you need to make a second call to `profile.set` with | ||
`tfa` set to an array of TWO codes from the user's authenticator, eg: | ||
`profile.set(tfa: [otp1, otp2]}, registry, {token})` | ||
authenticator application. This is typically done as a QRCODE, but you | ||
can also show the value of the `secret` key in the `otpauth` query string | ||
and they can type or copy paste that in. | ||
4. To complete setting up two factor auth you need to make a second call to | ||
`profile.set` with `tfa` set to an array of TWO codes from the user's | ||
authenticator, eg: `profile.set(tfa: [otp1, otp2]}, registry, {token})` | ||
5. On success you'll get a result object with a `tfa` property that has an | ||
@@ -232,0 +234,0 @@ array of one-time-use recovery codes. These are used to authenticate |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
21353
167
393
1