( exclude?: AuthMethod, )
| 455 | } |
| 456 | |
| 457 | function 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 | |
| 467 | function isUsingAuthentication(authMethod: AuthMethod): boolean { |
| 468 | const providerId = getProviderId(authMethod); |
no test coverage detected