MCPcopy
hub / github.com/lingodotdev/lingo.dev / tryAuthenticate

Function tryAuthenticate

packages/cli/src/cli/cmd/status.ts:668–683  ·  view source on GitHub ↗
(settings: ReturnType<typeof getSettings>)

Source from the content-addressed store, hash-verified

666}
667
668async function tryAuthenticate(settings: ReturnType<typeof getSettings>) {
669 if (!settings.auth.apiKey) {
670 return null;
671 }
672
673 try {
674 const authenticator = createAuthenticator({
675 apiKey: settings.auth.apiKey,
676 apiUrl: settings.auth.apiUrl,
677 });
678 const user = await authenticator.whoami();
679 return user;
680 } catch (error) {
681 return null;
682 }
683}
684
685function validateParams(
686 i18nConfig: I18nConfig | null,

Callers 1

status.tsFile · 0.85

Calls 2

createAuthenticatorFunction · 0.90
whoamiMethod · 0.80

Tested by

no test coverage detected