MCPcopy Create free account
hub / github.com/anus-dev/ANUS / authFlow

Function authFlow

packages/cli/src/ui/hooks/useAuthCommand.ts:45–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43
44 useEffect(() => {
45 const authFlow = async () => {
46 const authType = settings.merged.selectedAuthType;
47 if (isAuthDialogOpen || !authType) {
48 return;
49 }
50
51 try {
52 setIsAuthenticating(true);
53 await config.refreshAuth(authType);
54 console.log(`Authenticated via "${authType}".`);
55 } catch (e) {
56 setAuthError(
57 `Grok authentication failed - please check your API key: ${getErrorMessage(e)}`,
58 );
59 openAuthDialog();
60 } finally {
61 setIsAuthenticating(false);
62 }
63 };
64
65 void authFlow();
66 }, [isAuthDialogOpen, settings, config, setAuthError, openAuthDialog]);

Callers 1

useAuthCommandFunction · 0.85

Calls 2

getErrorMessageFunction · 0.85
refreshAuthMethod · 0.80

Tested by

no test coverage detected