Skip to content

Commit

Permalink
Merge pull request tj#754 from spacewander/prompt_passwd_before_2fa
Browse files Browse the repository at this point in the history
git-fork: prompt for password before 2FA code.
  • Loading branch information
hemanth authored Jun 3, 2019
2 parents 4b09e94 + c3c0bdf commit 1712db2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/git-fork
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ test -z "$url" && abort "github repo needs to be specified as an argument"
echo "Enter your github username"
read user
[ -n "$user" ] || abort "git username required"
echo "Enter github password for user \"$user\""
read -s passwd
echo "Enter github two-factor authentication code (leave blank if not set up)"
read MFA_CODE

Expand All @@ -33,7 +35,7 @@ fi
# create fork
curl -qsf \
-X POST \
-u "$user" \
-u "$user:$passwd" \
-H "X-GitHub-OTP: $MFA_CODE" \
"https://api.github.com/repos/$owner/$project/forks"

Expand Down

0 comments on commit 1712db2

Please sign in to comment.