$53 GRAYBYTE WORDPRESS FILE MANAGER $96

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/lib/auth/

HOME
Current File : /opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/lib/auth//legacy.js
'use strict'
const read = require('../utils/read-user-info.js')
const profile = require('npm-profile')
const log = require('npmlog')
const npm = require('../npm.js')
const output = require('../utils/output.js')
const pacoteOpts = require('../config/pacote')
const fetchOpts = require('../config/fetch-opts')

module.exports.login = function login (creds, registry, scope, cb) {
  let username = creds.username || ''
  let password = creds.password || ''
  let email = creds.email || ''
  const auth = {}
  if (npm.config.get('otp')) auth.otp = npm.config.get('otp')

  return read.username('Username:', username, {log: log}).then((u) => {
    username = u
    return read.password('Password: ', password)
  }).then((p) => {
    password = p
    return read.email('Email: (this IS public) ', email, {log: log})
  }).then((e) => {
    email = e
    return profile.login(username, password, {registry: registry, auth: auth}).catch((err) => {
      if (err.code === 'EOTP') throw err
      return profile.adduser(username, email, password, {
        registry: registry,
        opts: fetchOpts.fromPacote(pacoteOpts())
      })
    }).catch((err) => {
      if (err.code === 'EOTP' && !auth.otp) {
        return read.otp('Authenticator provided OTP:').then((otp) => {
          auth.otp = otp
          return profile.login(username, password, {registry: registry, auth: auth})
        })
      } else {
        throw err
      }
    })
  }).then((result) => {
    const newCreds = {}
    if (result && result.token) {
      newCreds.token = result.token
    } else {
      newCreds.username = username
      newCreds.password = password
      newCreds.email = email
      newCreds.alwaysAuth = npm.config.get('always-auth')
    }

    log.info('adduser', 'Authorized user %s', username)
    const scopeMessage = scope ? ' to scope ' + scope : ''
    output('Logged in as %s%s on %s.', username, scopeMessage, registry)
    cb(null, newCreds)
  }).catch(cb)
}


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.42 PM
root / root
0755
legacy.js
1.911 KB
28 Sep 2021 11.28 AM
root / root
0644
oauth.js
0.178 KB
28 Sep 2021 11.28 AM
root / root
0644
saml.js
0.177 KB
28 Sep 2021 11.28 AM
root / root
0644
sso.js
1.833 KB
28 Sep 2021 11.28 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF