//#region src/auth/mode.ts
/**
* Determine the active auth mode from config.
*
* Accepts `EmDashConfig` (or subtype) — checks for `auth` field via duck typing.
*
* @param config EmDash configuration
* @returns The active auth mode
*/
function getAuthMode(config) {
	const auth = config?.auth;
	if (auth && "entrypoint" in auth && auth.entrypoint) return {
		type: "external",
		providerType: auth.type,
		entrypoint: auth.entrypoint,
		config: auth.config
	};
	return { type: "passkey" };
}

//#endregion
export { getAuthMode as t };
//# sourceMappingURL=mode-BM9QgEmt.mjs.map