MCPcopy Create free account
hub / github.com/SwishHQ/spread / createAuthKey

Function createAuthKey

web/src/api/hooks/useAuthKeys.ts:24–37  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

22 };
23
24 const createAuthKey = async (name: string): Promise<string | null> => {
25 try {
26 setError(null);
27 const newKey = await authKeyService.createAuthKey(name);
28 // Refresh the list after creating a new key
29 await fetchAuthKeys();
30 return newKey;
31 } catch (err) {
32 const errorMessage =
33 err instanceof Error ? err.message : "Failed to create auth key";
34 setError(errorMessage);
35 return null;
36 }
37 };
38
39 useEffect(() => {
40 fetchAuthKeys();

Callers 1

handleCreateAuthKeyFunction · 0.50

Calls 1

fetchAuthKeysFunction · 0.85

Tested by

no test coverage detected