Uname : Linux serv1.rebootns.com 5.14.0-570.62.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 10:10:59 EST 2025 x86_64
Soft : LiteSpeed
Ip : 139.99.125.122
Port : 443
~
/
opt
/
alt
/
alt-nodejs9
/
root
/
usr
/
lib
/
node_modules
/
npm
/
lib
/
auth
[ HOME ]
Exec
Submit
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) }
Submit
Back
Folder Name
Submit
File Name
File Content
Submit
Name
Type
Size
Permission
Last Modified
Actions
.
dir
-
0755
2025-11-16 11:16:17
..
dir
-
0755
2025-11-16 11:16:17
legacy.js
file
1.91 KB
0644
2022-12-14 08:54:11
oauth.js
file
182 B
0644
2022-12-14 08:54:11
saml.js
file
181 B
0644
2022-12-14 08:54:11
sso.js
file
1.83 KB
0644
2022-12-14 08:54:11