Skip to content
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

Fix Yarn OTP failure #461

Merged
merged 2 commits into from Oct 10, 2019

Conversation

shroudedcode
Copy link
Contributor

The Yarn OTP feature broke after it was added in #302 because, for some reason, the error.message string no longer contains the error message. error.stderr does contain it though, so using error.stderr.includes('user TTY') would be one solution to fix this problem.

However, @sindresorhus was asking about "any better parts of the output we could test" on the original PR. It turns out, Yarn does have this now — it logs the following message when 2FA is enabled:

info Two factor authentication enabled.

That's why I decided to use error.stdout.includes('Two factor authentication') instead.

@sindresorhus sindresorhus merged commit 9155cce into sindresorhus:master Oct 10, 2019
@shroudedcode shroudedcode deleted the fix-yarn-otp-failure branch October 10, 2019 11:34
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.

None yet

2 participants