MCPcopy Index your code
hub / github.com/npmx-dev/npmx.dev / detectOtpRequired

Function detectOtpRequired

cli/src/npm-client.ts:86–100  ·  view source on GitHub ↗
(stderr: string)

Source from the content-addressed store, hash-verified

84}
85
86function detectOtpRequired(stderr: string): boolean {
87 const otpPatterns = [
88 'EOTP',
89 'one-time password',
90 'This operation requires a one-time password',
91 'OTP required for authentication',
92 '--otp=<code>',
93 ]
94 const lowerStderr = stderr.toLowerCase()
95 logDebug('Checking for OTP requirement in stderr:', stderr)
96 logDebug('OTP patterns:', otpPatterns)
97 const result = otpPatterns.some(pattern => lowerStderr.includes(pattern.toLowerCase()))
98 logDebug('OTP required:', result)
99 return result
100}
101
102function detectAuthFailure(stderr: string): boolean {
103 const authPatterns = [

Callers 2

execNpmInteractiveFunction · 0.85
execNpmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected