Skip to content

Commit

Permalink
Show raw response on auth failure when registering Wireguard keys wit…
Browse files Browse the repository at this point in the history
…h endpoint
  • Loading branch information
thrnz committed Sep 4, 2024
1 parent 5c6fd5d commit 71ea5ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extra/wg-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ get_wgconf () {
"https://$wg_cn:$wg_port/addKey" > "$addkey_response"
fi

[ "$(jq -r .status "$addkey_response")" == "ERROR" ] && [ "$(jq -r .message "$addkey_response")" == "Login failed!" ] && echo "Auth failed" && fatal_error 2
[ "$(jq -r .status "$addkey_response")" == "ERROR" ] && [ "$(jq -r .message "$addkey_response")" == "Login failed!" ] && echo "Auth failed" && cat "$addkey_response" && fatal_error 2
[ "$(jq -r .status "$addkey_response")" != "OK" ] && echo "WG key registration failed" && cat "$addkey_response" && fatal_error 4

peer_ip="$(jq -r .peer_ip "$addkey_response")"
Expand Down

0 comments on commit 71ea5ba

Please sign in to comment.