fix: handle null user for tag-only nodes in Headscale 0.28+

In Headscale 0.28+, nodes can be registered with tag-only preauth keys
which have no associated user. This change updates the Machine type to
make user optional and adds null checks throughout the codebase where
node.user is accessed.

Fixes tag node operations (rename, add tags) that previously failed
with 'Unexpected Server Error' when accessing node.user.providerId
on nodes without a user association.

Refs: #432
This commit is contained in:
drifterza
2026-02-24 13:32:41 +02:00
parent 9183ec2942
commit badefc7f85
8 changed files with 822 additions and 843 deletions
+2 -1
View File
@@ -9,7 +9,8 @@ export interface Machine {
ipAddresses: string[];
name: string;
user: User;
// User can be null for tag-only nodes in Headscale 0.28+
user?: User;
lastSeen: string;
expiry: string | null;