(advertised: readonly string[] | undefined)
| 748 | type DcrAuthMethod = (typeof SUPPORTED_DCR_AUTH_METHODS)[number]; |
| 749 | |
| 750 | const negotiateAuthMethod = (advertised: readonly string[] | undefined): DcrAuthMethod | null => { |
| 751 | if (!advertised || advertised.length === 0) return "none"; |
| 752 | for (const candidate of SUPPORTED_DCR_AUTH_METHODS) { |
| 753 | if (advertised.includes(candidate)) return candidate; |
| 754 | } |
| 755 | return null; |
| 756 | }; |
| 757 | |
| 758 | // --------------------------------------------------------------------------- |
| 759 | // Convenience: begin the full dynamic flow in one call |
no outgoing calls
no test coverage detected