import { useMemo } from 'react';
import { isTruthy } from '../../utils/isTruthy.mjs';
import { useAdminPortalOrgUIConfig } from '../StytchClientContext.mjs';

const configAuthMethodMap = {
    emailMagicLinks: 'magic_link',
    emailOtp: 'email_otp',
    sso: 'sso',
    password: 'password',
    oauthGoogle: 'google_oauth',
    oauthMicrosoft: 'microsoft_oauth',
    oauthHubspot: 'hubspot_oauth',
    oauthSlack: 'slack_oauth',
    oauthGithub: 'github_oauth'
};
const useAllowedAuthMethods = ()=>{
    const orgUIConfig = useAdminPortalOrgUIConfig();
    return useMemo(()=>{
        const authMethods = orgUIConfig?.allowedAuthMethods ?? Object.keys(configAuthMethodMap);
        return authMethods.map((method)=>configAuthMethodMap[method]).filter(isTruthy);
    }, [
        orgUIConfig?.allowedAuthMethods
    ]);
};

export { configAuthMethodMap, useAllowedAuthMethods };
//# sourceMappingURL=useAllowedAuthMethods.mjs.map
