From 91eadf96d21521bcb3f90d21c4e2c95839380d8b Mon Sep 17 00:00:00 2001 From: bitbronze <48721834+bitbronze@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:54:40 +0300 Subject: [PATCH] convert email to username Upstream Headscale API is returning user emails instead of user names. Which breaks key expiry and key filtering. The commit fixes this issue. --- app/routes/settings/auth-keys.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/routes/settings/auth-keys.tsx b/app/routes/settings/auth-keys.tsx index b9fabc6..6ca9710 100644 --- a/app/routes/settings/auth-keys.tsx +++ b/app/routes/settings/auth-keys.tsx @@ -118,6 +118,11 @@ export async function loader({ }), ); + // Upstream Headscale API is returning user emails instead of user names + preAuthKeys.forEach((preauthkey_item, index) => { + preauthkey_item.user = preauthkey_item.user.split('@')[0] + }); + return { keys: preAuthKeys.flatMap((keys) => keys.preAuthKeys), users: users.users,