feat: make api calls more resilient and stuff

This commit is contained in:
Aarnav Tale
2026-05-25 17:06:14 -04:00
parent 09be95c7bc
commit 56c5e5ac8c
16 changed files with 118 additions and 79 deletions
+3
View File
@@ -56,6 +56,9 @@ export async function loader({ request, context }: Route.LoaderArgs) {
});
try {
// Looks up the Headscale user that matches this OIDC identity. We use
// the configured admin API key here — not a per-request one — because
// there is no per-request key yet (the session is being created).
const hsApi = context.headscale.client(context.headscaleApiKey!);
const hsUsers = await hsApi.users.list();
const hsUser = findHeadscaleUserBySubject(hsUsers, identity.subject, identity.email);