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 8f46ffa commit d01edd7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tailscale-whoami/whoami.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ const whoami = async (ip: string): Promise<Device | undefined> => {
},
);

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

const devices = JSON.parse(body) as DevicesResponse;

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

Expand Down

0 comments on commit d01edd7

Please sign in to comment.