Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npm-profile

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-profile - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

4

index.js

@@ -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 @@ }

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc