Skip to content

Commit

Permalink
Add token login
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-kleiner authored Aug 27, 2022
1 parent 76d1e8c commit fbdda71
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions rootfs/usr/bin/nord_login
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ fi

[[ -z "${PASS}" ]] && [[ -f "${PASSFILE}" ]] && PASS="$(head -n 1 "${PASSFILE}")"
nordvpn logout > /dev/null
nordvpn login --legacy --username "${USER}" --password "${PASS}" || {
echo "Invalid Username or password."
exit 1
}

exit 0
if [[ -n ${TOKEN} ]]; then
nordvpn login --token "${TOKEN}" || {
echo "Invalid token."
exit 1
}
else
nordvpn login --legacy --username "${USER}" --password "${PASS}" || {
echo "Invalid Username or password."
exit 1
}
fi

exit 0

0 comments on commit fbdda71

Please sign in to comment.