fix: filter out empty users in auth-keys, potential headscale bug
This commit is contained in:
parent
69c6fc4847
commit
5e332c4a5c
@ -22,15 +22,17 @@ export async function loader({
|
|||||||
);
|
);
|
||||||
|
|
||||||
const preAuthKeys = await Promise.all(
|
const preAuthKeys = await Promise.all(
|
||||||
users.users.map((user) => {
|
users.users
|
||||||
const qp = new URLSearchParams();
|
.filter((user) => user.name?.length > 0) // Filter out any invalid users
|
||||||
qp.set('user', user.name);
|
.map((user) => {
|
||||||
|
const qp = new URLSearchParams();
|
||||||
|
qp.set('user', user.name);
|
||||||
|
|
||||||
return context.client.get<{ preAuthKeys: PreAuthKey[] }>(
|
return context.client.get<{ preAuthKeys: PreAuthKey[] }>(
|
||||||
`v1/preauthkey?${qp.toString()}`,
|
`v1/preauthkey?${qp.toString()}`,
|
||||||
session.get('api_key')!,
|
session.get('api_key')!,
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user