Skip to content

Commit

Permalink
Add hint to skip 2FA in case the app password was used
Browse files Browse the repository at this point in the history
Signed-off-by: yubiuser <[email protected]>
  • Loading branch information
yubiuser committed Feb 18, 2025
1 parent f697f99 commit a0833ee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions padd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ LoginAPI() {
# Try to read the CLI password (if enabled and readable by the current user)
if [ -r /etc/pihole/cli_pw ]; then
password=$(cat /etc/pihole/cli_pw)
# If we can read the CLI password, we can skip 2FA even when it's required
# If we can read the CLI password, we can skip 2FA even when it's required otherwise
needTOTP=false
fi

Expand All @@ -207,7 +207,8 @@ LoginAPI() {

if [ "${needTOTP}" = true ] && [ -z "${totp}" ]; then
# 2FA required, but no TOTP was supplied as argument
moveXOffset; echo "Please enter the correct second factor:"
moveXOffset; echo "Please enter the correct second factor."
moveXOffset; echo "(Can be any number if you used the app password)"
moveXOffset; read -r totp
fi

Expand All @@ -234,6 +235,7 @@ LoginAPI() {

if [ "${needTOTP}" = true ]; then
moveXOffset; echo "Please enter the correct second factor:"
moveXOffset; echo "(Can be any number if you used the app password)"
moveXOffset; read -r totp
fi

Expand Down

0 comments on commit a0833ee

Please sign in to comment.