MCPcopy
hub / github.com/monkeytypegame/monkeytype / getPreferredAuthenticationMethod

Function getPreferredAuthenticationMethod

frontend/src/ts/auth.tsx:457–465  ·  view source on GitHub ↗
(
  exclude?: AuthMethod,
)

Source from the content-addressed store, hash-verified

455}
456
457function getPreferredAuthenticationMethod(
458 exclude?: AuthMethod,
459): AuthMethod | undefined {
460 const filteredMethods = typedKeys(authMethods).filter((it) => it !== exclude);
461 for (const method of filteredMethods) {
462 if (isUsingAuthentication(method)) return method;
463 }
464 return undefined;
465}
466
467function isUsingAuthentication(authMethod: AuthMethod): boolean {
468 const providerId = getProviderId(authMethod);

Callers 1

reauthenticateFunction · 0.85

Calls 2

typedKeysFunction · 0.90
isUsingAuthenticationFunction · 0.85

Tested by

no test coverage detected