Skip to content

fix: add otplease for enable-2fa, disable-2fa, access #8228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: latest
Choose a base branch
from

Conversation

reggi
Copy link
Contributor

@reggi reggi commented Apr 15, 2025

The profile enable-2fa and profile disable-2fa commands a broken. This fixes them by wrapping the calls in otplease which handles error headers / prompts with tfa urls.

Closes: #8192

@reggi reggi requested a review from a team as a code owner April 15, 2025 17:18
@wraithgar wraithgar marked this pull request as draft April 16, 2025 14:34
@wraithgar
Copy link
Member

This command needs to land after a registry PR, do not merge until then.

Converting to draft as an extra precaution.

@reggi reggi changed the title fixes enable and disable 2fa commands fix: enable and disable 2fa commands Apr 17, 2025
@wraithgar

This comment was marked as outdated.

@reggi reggi marked this pull request as ready for review April 25, 2025 17:56
@reggi reggi changed the title fix: enable and disable 2fa commands fix: add otplease for enable-2fa, disable-2fa,access Apr 25, 2025
@reggi reggi changed the title fix: add otplease for enable-2fa, disable-2fa,access fix: add otplease for enable-2fa, disable-2fa, access Apr 25, 2025
}

log.info('profile', 'Setting two-factor authentication to ' + mode)
const challenge = await set(info, conf)
const challenge = await otplease(this.npm, conf, c => set(info, c))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const challenge = await otplease(this.npm, conf, c => set(info, c))
const challenge = await otplease(this.npm, conf, o => set(info, o))

I know this is nitpicky but I believe we have tried to consistently refer to this param as "opts", shortened to "o" sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] npm profile enable-2fa preforms operation but shows error
2 participants