Skip to content

Commit

Permalink
whoami debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
zegl committed May 26, 2024
1 parent c1d011a commit 8f46ffa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tailscale-whoami/whoami.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ const whoami = async (ip: string): Promise<Device | undefined> => {

const devices = await jsonResponse.json() as DevicesResponse;

if (!devices || !devices.devices) {
console.log(`Unexpected devices response`);
console.log(await jsonResponse.text());
return;
}

const device = devices.devices.find((device) =>
device.addresses.includes(ip)
);
Expand Down

0 comments on commit 8f46ffa

Please sign in to comment.