@authing/react-ui-components 2.4.55-alpha.5 → 2.4.56-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- {"version":3,"sources":["components/AuthingGuard/types/GuardState.ts","components/AuthingGuard/types/Locales.ts","context/global/reducer.tsx","context/base.tsx","context/global/context.tsx","components/AuthingGuard/locales/index.ts","components/AuthingGuard/api/http.ts","components/AuthingGuard/constants.ts","utils/popupCenter.ts","utils/index.ts","components/AuthingGuard/MfaLayout/Steps.ts","components/AuthingGuard/Header/index.tsx","components/AuthingGuard/Forms/LoginFormFooter/index.tsx","components/AuthingGuard/Forms/ADLoginForm/index.tsx","components/AuthingGuard/Forms/ResetPwdForm/Step1.tsx","components/AuthingGuard/Forms/SendPhoneCode/SendCodeBtn.tsx","components/AuthingGuard/Forms/SendPhoneCode/index.tsx","components/AuthingGuard/Forms/ResetPwdForm/Step2.tsx","components/AuthingGuard/Forms/ResetPwdForm/Step3.tsx","components/AuthingGuard/Forms/ResetPwdForm/Step4.tsx","components/AuthingGuard/Forms/ResetPwdForm/Footer.tsx","components/AuthingGuard/Forms/ResetPwdForm/index.tsx","common/VerifyCodeInput/index.tsx","components/AuthingGuard/Forms/MfaVerifyForm/index.tsx","components/AuthingGuard/Forms/LdapLoginForm/index.tsx","components/AuthingGuard/Forms/QrCodeLoginForm/index.tsx","components/AuthingGuard/Forms/MfaResetCodeForm/Step1.tsx","common/CopyAbleText/index.tsx","utils/clipboard.ts","components/AuthingGuard/Forms/MfaResetCodeForm/Step2.tsx","components/AuthingGuard/Forms/MfaResetCodeForm/index.tsx","components/AuthingGuard/Forms/RegisterFormFooter/index.tsx","components/AuthingGuard/Forms/Agreements/index.tsx","components/AuthingGuard/Forms/EmailRegisterForm/index.tsx","components/AuthingGuard/Forms/PhoneRegisterForm/index.tsx","components/AuthingGuard/Forms/PasswordLoginForm/index.tsx","components/AuthingGuard/IconFont/iconfont.js","components/AuthingGuard/IconFont/svg.js","components/AuthingGuard/hooks/useScreenSize.tsx","components/AuthingGuard/IconFont/index.tsx","components/AuthingGuard/api/appConfig.ts","components/AuthingGuard/Forms/SocialAndIdpLogin/index.tsx","components/AuthingGuard/Forms/PhoneCodeLoginForm/index.tsx","components/AuthingGuard/Forms/SmsMfaVerifyForm/CheckPhoneForm.tsx","components/AuthingGuard/Forms/SmsMfaVerifyForm/VerifyCodeForm.tsx","components/AuthingGuard/Forms/SmsMfaVerifyForm/index.tsx","components/AuthingGuard/Forms/EmailMfaVerifyForm/CheckEmailForm.tsx","components/AuthingGuard/Forms/EmailMfaVerifyForm/VerifyCodeForm.tsx","components/AuthingGuard/Forms/EmailMfaVerifyForm/index.tsx","components/AuthingGuard/MfaLayout/index.tsx","common/AuthingTabs/index.tsx","components/AuthingGuard/LoginLayout/index.tsx","components/AuthingGuard/RegisterLayout/index.tsx","components/AuthingGuard/ResetPwdLayout/index.tsx","components/AuthingGuard/api/userPoolConfig.ts","components/AuthingGuard/Forms/UploadImage/index.tsx","components/AuthingGuard/Forms/CompleteUserInfoForm/index.tsx","components/AuthingGuard/CompleteUserInfoLayout/index.tsx","common/AuthingDropdown/index.tsx","components/AuthingGuard/AppMFALayout/index.tsx","components/AuthingGuard/ToggleLang/index.tsx","components/AuthingGuard/GuardLayout/index.tsx","components/AuthingGuard/api/sso.ts","components/AuthingGuard/index.tsx","reportWebVitals.ts","index.tsx","components/AuthingGuard/types/index.ts","components/AuthingGuard/types/GuardConfig.ts"],"names":["LANG_MAP","label","value","handlers","state","payloads","key","reducer","type","handler","ctx","React","createContext","undefined","ctxConst","useContext","Error","createBaseContext","Context","useBaseContext","useGuardContext","GuardContext","children","useReducer","dispatch","setValue","useCallback","getValue","Provider","langChangeFN","changeLang","lang","i18n","changeLanguage","requestClient","a","fetch","res","json","get","path","query","init","headers","langHeader","language","tenantId","tenantHeader","baseUrl","qs","stringify","addQueryPrefix","credentials","post","data","config","method","body","JSON","setBaseUrl","base","replace","DEFAULT_LANG_HEADER","setLangHeader","setTenantHeader","setTenantId","ApplicationMfaType","OTP_MFA_CODE","APP_MFA_CODE","LOGIN_METHODS_MAP","LoginMethods","Password","t","PhoneCode","AppQr","WxMinQr","LDAP","AD","WechatMpQrcode","REGISTER_METHODS_MAP","RegisterMethods","Email","Phone","HIDE_SOCIALS","defaultGuardConfig","isSSO","title","text","loginTabs","loginBtn","normal","loading","registerBtn","escCloseable","autoRegister","clickCloseable","mode","GuardMode","Normal","disableRegister","disableResetPwd","defaultScenes","GuardScenes","Login","appHost","defaultLoginMethod","defaultRegisterMethod","loginMethods","registerMethods","logo","passwordLoginMethods","defaultLocalesConfig","defaultLang","isShowChange","defaultHeaders","popupCenter","url","w","h","dualScreenLeft","window","screenLeft","screenX","dualScreenTop","screenTop","screenY","width","innerWidth","document","documentElement","clientWidth","screen","height","innerHeight","clientHeight","systemZoom","availWidth","left","top","newWindow","open","focus","VALIDATE_PATTERN","email","phone","ip","host","validate","val","test","getRequiredRules","msg","required","message","getDeviceName","userAgent","navigator","platform","os","indexOf","insertedRecord","appConfig","userConfig","insertStyles","styles","recordKey","styleElt","styleSheet","createStyleSheet","head","getElementsByTagName","createElement","appendChild","styleSheets","length","innerHTML","cssText","i","selector","insertRule","rule","addRule","removeStyles","parentNode","removeChild","getClassnames","classnames","filter","Boolean","join","isObject","item","Array","isArray","deepMerge","target","sources","source","shift","Object","assign","Steps","getUserRegisterParams","parse","location","search","ignoreQueryPrefix","keys","map","GuardHeader","props","description","className","src","size","LoginFormFooter","needRestPwd","needRegister","useTranslation","htmlType","block","onClick","RestPassword","Register","ADLoginForm","forwardRef","ref","onSuccess","onValidateFail","onFail","authClient","guardEvents","useState","setLoading","useForm","rawForm","onFinish","values","onBeforeLogin","identity","password","error","trim","loginByAd","user","errorData","useImperativeHandle","form","onSubmitCapture","onFinishFailed","errorInfo","Item","name","rules","autoComplete","placeholder","prefix","UserOutlined","style","color","visibilityToggle","LockOutlined","ResetPasswordStep1","phoneOrEmail","sendEmail","EmailScene","ResetPassword","onPwdEmailSend","success","ResetPwdMethods","onPwdEmailSendError","validateTrigger","validator","Promise","resolve","reject","SendCodeBtn","beforeSend","btnRef","countDown","setCountDown","timerRef","useRef","useEffect","clearInterval","current","enabled","useMemo","send","setInterval","prev","useSentCounter","disabled","e","spinning","indicator","LoadingOutlined","spin","time","SendPhoneCode","onSend","onError","sendSmsCode","ResetPasswordStep2","onStep2Finish","code","resetPasswordByPhoneCode","initialValue","readOnly","concat","len","SafetyOutlined","suffix","onPwdPhoneSendError","onPwdPhoneSend","getFieldValue","ResetPasswordStep3","reseting","setReseting","sending","setSending","onSendResetMail","onStep3Finish","resetPasswordByEmailCode","marginBottom","padding","ghost","ResetPasswordStep4","textAlign","fontSize","fontFamily","number","ResetPwdFormFooter","ResetPasswordForm","step","setStep","setPhone","setEmail","onStep1Finish","onStep2OrStep3Finish","onStep2OrStep3Fail","getForm","VerifyCodeInput","verifyCode","setVerifyCode","onEnter","inputRef","handleChange","index","num","parseInt","isNaN","String","codes","split","slice","fill","_","el","autoFocus","onKeyDown","evt","currentVal","keyCode","handleKeyDown","onChange","Math","floor","MFAVerifyForm","goReset","mfaToken","mfaData","MfaCode","setMFACode","mfa","verifyTotpMfa","totp","some","LdapLoginForm","realHost","needCaptcha","setNeedCaptcha","verifyCodeUrl","setVerifyCodeUrl","captchaUrl","getCaptchaUrl","Date","captchaCode","loginByLdap","formItems","component","addonAfter","alt","cursor","hide","QrCodeLoginForm","idpId","client","qrcode","wxqrcode","wechatmpqrcode","startScanning","extIdpConnId","autoExchangeUserInfo","qrCodeScanOptions","onStart","timer","id","MfaResetStep1","goVerify","verifyTotpRecoveryCode","recoveryCode","recoverCode","CopyAbleText","divRef","copied","setCopied","startTimer","clearTimeout","setTimeout","CheckOutlined","data-tips","CopyOutlined","str","setAttribute","position","selected","getSelection","rangeCount","getRangeAt","select","execCommand","removeAllRanges","addRange","console","warn","copyToClipboard","innerText","MfaResetStep2","valuePropName","r","v","MfaResetCodeForm","setUser","setRecoverCode","stepMap","1","2","RegisterFormFooter","Agreements","showError","agreements","acceptList","setAcceptList","isAccept","every","includes","align","checked","dangerouslySetInnerHTML","__html","EmailRegisterForm","agreementEnabled","acceptedAgreements","setAcceptedAgreements","validated","setValidated","onBeforeRegister","validateFields","registerByEmail","browser","device","generateToken","params","pattern","PhoneRegisterForm","registerByPhoneCode","PasswordLoginForm","userPoolId","appId","loginMethodsText","sort","usernamePlaceholder","b","identityRules","push","login","encrypt","options","encryptFunction","publicKey","account","customData","c","l","o","m","getAttribute","__iconfont__svg__cssinject__","write","log","n","overflow","firstChild","insertBefore","addEventListener","readyState","removeEventListener","attachEvent","doScroll","onreadystatechange","ScreenSize","IconFont","xlinkHref","inRange","start","end","SCREEN_SIZE_RANG","Mobile","range","Desktop","Infinity","getScreenSize","viewportWidth","find","useScreenSize","screenSize","setScreenSize","onResize","fn","delay","immediate","context","this","args","arguments","apply","debounce","SocialAndIdpLogin","noForm","onMessage","errMsg","event","eventType","parsedMsg","authingCode","localStorage","setItem","token","idpButtons","enterpriseConnectionObjs","protocol","Protocol","OIDC","configItem","shortid","generate","client_id","clientId","redirect_uri","redirectUri","scope","scopes","response_type","responseType","nonce","authorizationEdpoint","identifier","icon","marginRight","referer","href","connection","providerIentifier","displayName","SAML","samlRequest","CAS","casConnectionLoginUrl","OAUTH","authUrl","AZURE_AD","authorizationUrl","socialLoginButtons","socialConnectionObjs","isWechatBrowser","provider","SocialConnectionProvider","WECHATMP","iconType","authorization_params","BAIDU","display","onLogin","social","authorize","tooltip","idp","direction","socialLogin","flex","minHeight","PhoneCodeLoginForm","rulesMap","loginByPhoneCode","CheckPhoneForm","phoneOrEmailBindable","VerifyCodeForm","sendCodeRef","sent","setSent","verifyAppSmsMfa","sendVerifyCode","SmsMfaVerifyForm","userPhone","click","CheckEmailForm","verifyAppEmailMfa","MfaVerify","EmailMfaVerifyForm","userEmail","MfaLayout","Verify","formProps","onLoginError","formMap","Reset","AuthingTabs","tabs","showLen","activeKey","onTabClick","activeIndex","findIndex","showTabs","startIndex","max","hideTabs","showKeys","EllipsisOutlined","SHOW_SOCIAL_LOGIN_TAB","LoginLayout","activeTabs","AppMfaVerify","useFormActions","formRef","LOGIN_FORM_MAP","loginMethodTitleMapping","tab","useNormalLoginTabs","RegisterLayout","extendsFields","CompleteUserInfo","onRegister","onRegisterError","REGISTER_FORM_MAP","next","ResetPwdLayout","onPwdResetError","onPwdReset","OIDCConnectionMode","ApplicationMfaTypeLabel","SMS","EMAIL","UploadImage","uploading","setUploading","apiHost","uploadButton","PlusOutlined","marginTop","accept","listType","showUploadList","action","info","status","file","response","CompleteUserInfoForm","submitting","setSubmitting","definitions","setDefinitions","internalFields","userFields","entries","forEach","nameOrId","udfs","definition","def","updateProfile","authorization","onRegisterInfoCompleted","onRegisterInfoCompletedError","getCurrentUser","INPUT_MAP","image","formFields","inputType","layout","CompleteUserInfoLayout","guardTitle","AuthingDropdown","menus","visible","setVisible","onMouseEnter","onMouseLeave","DownOutlined","AppMfaLayout","setType","availableMfaType","applicationMfa","mfaPolicy","ToggleLang","overlay","setLang","alignSelf","useGuardConfig","setAppConfig","errorMsg","setErrorMsg","errorDetail","setErrorDetail","checkConfig","fetchAppConfig","then","catch","finally","css","contentCss","guardConfig","socialConnections","socials","enterpriseConnections","identityProviders","list","passwordTabConfig","enabledLoginMethods","defaultV2","default","registerTabs","ssoPageComponentDisplay","autoRegisterThenLoginHintInfo","GuardLayout","reactiveUserConfig","guardScenes","localesConfig","isModal","Modal","isControlled","localVisible","setLocalVisible","realVisible","toggleLocalVisible","useModal","onLoginTabChange","onRegisterTabChange","register","hidden","setHidden","closeHandler","onClose","onLoadError","onLoad","sessionData","typedData","userInfo","layoutMap","zIndex","onTransitionEnd","PREFIX_CLS","prefixCls","AuthingGuard","appDomain","use","LanguageDetector","initReactI18next","detection","order","resources","translation","enUsTrans","zhCnTrans","fallbackLng","debug","interpolation","escapeValue","initI18n","parsedUrl","URL","port","AuthenticationClient","requestFrom","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","App","setTitle","ReactDOM","render","getElementById","SocialConnections"],"mappings":"wKACA,O,iCCCA,kCAAO,IAAMA,EAAW,CACtB,CACEC,MAAO,eACPC,MAAO,SAET,CACED,MAAO,UACPC,MAAO,W,+zsCC8BX,IAAMC,EAAa,eAEhB,aAAc,SAACC,EAAeC,GAC7B,OAAO,2BACFD,GADL,kBAEGC,EAASC,IAAMD,EAASH,WAKlBK,EAAU,SAACH,EAAD,GAAwD,IAAtCI,EAAqC,EAArCA,KAASH,EAA4B,wBACtEI,EAAUN,EAASK,GACzB,OAAIC,EACKA,EAAQL,EAAOC,GAEjBD,G,EClDF,WACL,IAAMM,EAAMC,IAAMC,mBAA6BC,GAQ/C,MAAO,CAACH,EAPR,WACE,IAAMI,EAAWH,IAAMI,WAAWL,GAClC,IAAKI,EACH,MAAM,IAAIE,MAAM,yDAClB,OAAOF,ICEuBG,G,mBAA3BC,E,KAASC,E,KAET,SAASC,IAGd,OAFqBD,IAKhB,SAASE,EAAT,GAGwC,IAAD,IAF5CC,gBAE4C,MAFjC,KAEiC,EAD5CpB,EAC4C,EAD5CA,MAC4C,EAClBqB,qBAAWhB,EAASL,GADF,mBACrCE,EADqC,KAC9BoB,EAD8B,KAGtCC,EAAWC,uBAAY,SAACpB,EAAmBJ,GAC/CsB,EAAS,CAAEhB,KAAM,YAAaF,MAAKJ,YAClC,IAECQ,EAAqB,CACvBN,QACAoB,WACAG,SARe,SAACrB,GAAD,OAAuBF,EAAME,IAS5CmB,YAGF,OAAO,kBAACP,EAAQU,SAAT,CAAkB1B,MAAOQ,GAAMY,G,qJC7BpCO,EAAqC,aAE5BC,EAAa,SAACC,GACzBC,IAAKC,eAAeF,GACpBF,GAAgBA,EAAaE,ICTlBG,EAAa,uCAAG,wCAAAC,EAAA,sEACTC,MAAK,WAAL,KADS,cACrBC,EADqB,yBAEpBA,EAAIC,QAFgB,2CAAH,qDAW1BJ,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,kCAAAA,M,cAiBAjQ,K,QAAAA,E,UAAAA,E,YAAAA,E,YAAAA,E,YAAAA,E,cAAAA,E,qBAAAA,M","file":"static/js/main.eeb41586.chunk.js","sourcesContent":["import { LoginMethods, RegisterMethods } from './GuardConfig'\nimport { GuardScenes } from '../../../components/AuthingGuard/types/GuardConfig'\n\nexport interface ActiveTabs {\n [GuardScenes.Login]: LoginMethods\n [GuardScenes.Register]: RegisterMethods\n}\n","export type Lang = 'zh-CN' | 'en-US'\n\nexport const LANG_MAP = [\n {\n label: '中文',\n value: 'zh-CN',\n },\n {\n label: 'English',\n value: 'en-US',\n },\n]\n","import {\n GuardConfig,\n ActiveTabs,\n GuardScenes,\n UserConfig,\n GuardEventsHandler,\n LocalesConfig,\n Lang,\n} from '../../components/AuthingGuard/types'\nimport { AuthenticationClient } from 'authing-js-sdk'\nimport { IBaseAction } from '../base'\nimport { ApplicationMfaType } from '../../components/AuthingGuard/api/appConfig'\n\nexport type IState = {\n config: GuardConfig // 处理后的 Guard 配置\n userConfig: UserConfig // 用户传入的配置\n authClient: AuthenticationClient\n activeTabs: ActiveTabs // 登录、注册方式\n guardScenes: GuardScenes // 当前在哪个界面\n guardTitle: string\n // 需要 mfa 登录时后端返回的错误信息\n mfaData: {\n mfaToken: string\n phone?: string\n email?: string\n applicationMfa?: {\n status: 0 | 1\n mfaPolicy: ApplicationMfaType\n sort: number\n }[]\n }\n userPoolId: string\n appId: string\n guardEvents: GuardEventsHandler\n localesConfig: LocalesConfig\n lang?: Lang\n realHost: string\n}\n\nconst handlers: any = {\n // eslint-disable-next-line\n ['SET_VALUE']: (state: IState, payloads: any) => {\n return {\n ...state,\n [payloads.key]: payloads.value,\n }\n },\n}\n\nexport const reducer = (state: IState, { type, ...payloads }: IBaseAction) => {\n const handler = handlers[type]\n if (handler) {\n return handler(state, payloads)\n }\n return state\n}\n","import React from 'react'\n\n// create context with no upfront defaultValue\n// without having to do undefined check all the time\nexport function createBaseContext<C>() {\n const ctx = React.createContext<C | undefined>(undefined)\n function useBaseContext() {\n const ctxConst = React.useContext(ctx)\n if (!ctxConst)\n throw new Error('useBaseContext must be inside a Provider with a value')\n return ctxConst\n }\n // make TypeScript infer a tuple, not an array of union types\n return [ctx, useBaseContext] as const\n}\n\nexport interface IBaseAction<ActionType = string> {\n type: ActionType & string\n payload?: any\n [key: string]: string\n}\n\nexport interface IBaseContext<S> {\n state: S\n [k: string]: any\n}\n\nexport type BaseContextComponent<Props> = React.PropsWithChildren<Props>\n","import React, { useCallback, useReducer } from 'react'\nimport { createBaseContext, IBaseContext, BaseContextComponent } from '../base'\nimport { reducer, IState } from './reducer'\n\n// 页面上下文,除了状态外还有公开的方法\nexport interface IGuardContext extends IBaseContext<IState> {\n dispatch: Function\n getValue: (key: keyof IState) => any\n setValue: (key: keyof IState, value: any) => void\n}\n\n// 实例化上下文,这里避免了为空检查\nconst [Context, useBaseContext] = createBaseContext<IGuardContext>()\n\nexport function useGuardContext(): IGuardContext {\n const guardContext = useBaseContext()\n // TODO: custom some\n return guardContext\n}\n\nexport function GuardContext({\n children = null,\n value,\n}: BaseContextComponent<Record<string, any>>) {\n const [state, dispatch] = useReducer(reducer, value)\n const getValue = (key: keyof IState) => state[key]\n const setValue = useCallback((key: keyof IState, value: any) => {\n dispatch({ type: 'SET_VALUE', key, value })\n }, [])\n\n let ctx: IGuardContext = {\n state,\n dispatch,\n getValue,\n setValue,\n }\n\n return <Context.Provider value={ctx}>{children}</Context.Provider>\n}\n","import i18n from 'i18next'\nimport { initReactI18next } from 'react-i18next'\nimport LanguageDetector from 'i18next-browser-languagedetector'\n\nimport * as enUsTrans from './en'\nimport * as zhCnTrans from './zh'\nimport { LocalesConfig, Lang } from '../types'\n\nlet langChangeFN: (lang: Lang) => void = () => {}\n\nexport const changeLang = (lang: Lang) => {\n i18n.changeLanguage(lang)\n langChangeFN && langChangeFN(lang)\n}\n\nconst initI18n = (localesConfig: LocalesConfig, lang?: Lang) => {\n if (!i18n.language) {\n i18n\n .use(LanguageDetector) // 监测当前浏览器语言\n .use(initReactI18next) // 初始化 i18n\n .init({\n detection: {\n order: [],\n },\n resources: {\n 'en-US': {\n translation: enUsTrans,\n },\n 'zh-CN': {\n translation: zhCnTrans,\n },\n },\n fallbackLng: localesConfig.defaultLang || lang || 'zh-CN',\n debug: false,\n interpolation: {\n escapeValue: false, // react already safes from xss\n },\n })\n if (localesConfig.onChange) {\n langChangeFN = localesConfig.onChange\n }\n }\n}\n\nexport { i18n, initI18n }\n","import qs from 'qs'\nimport { i18n } from '../locales'\n\nexport const requestClient = async (...rest: Parameters<typeof fetch>) => {\n const res = await fetch(...rest)\n return res.json()\n}\n\nexport interface AuthingResponse<T = any> {\n code: number\n message?: string\n data?: T\n}\n\nrequestClient.get = async <T>(\n path: string,\n query: Record<string, any> = {},\n init?: RequestInit\n): Promise<AuthingResponse<T>> => {\n const headers: Record<string, any> = {\n ...init?.headers,\n 'Content-Type': 'application/json',\n [requestClient.langHeader]: i18n.language,\n }\n\n if (requestClient.tenantId !== '')\n headers[requestClient.tenantHeader] = requestClient.tenantId\n\n const res = await fetch(\n `${requestClient.baseUrl}${path}${qs.stringify(query, {\n addQueryPrefix: true,\n })}`,\n {\n ...init,\n credentials: 'include',\n headers,\n }\n )\n\n return res.json()\n}\n\nrequestClient.post = async <T>(\n path: string,\n data: any,\n config?: {\n headers: any\n }\n): Promise<AuthingResponse<T>> => {\n const headers: Record<string, any> = {\n ...config?.headers,\n 'Content-Type': 'application/json',\n [requestClient.langHeader]: i18n.language,\n }\n\n if (requestClient.tenantId !== '')\n headers[requestClient.tenantHeader] = requestClient.tenantId\n\n const res = await fetch(`${requestClient.baseUrl}${path}`, {\n method: 'POST',\n body: JSON.stringify(data),\n credentials: 'include',\n headers: headers,\n })\n return res.json()\n}\n\nrequestClient.baseUrl = ''\nrequestClient.setBaseUrl = (base: string) => {\n requestClient.baseUrl = base.replace(/\\/$/, '')\n}\nconst DEFAULT_LANG_HEADER = 'x-authing-lang'\nconst DEFAULT_TENANT_HEADER = 'x-authing-app-tenant-idåå'\nrequestClient.langHeader = DEFAULT_LANG_HEADER\nrequestClient.tenantHeader = DEFAULT_TENANT_HEADER\nrequestClient.tenantId = ''\n\nrequestClient.setLangHeader = (key: string | undefined) => {\n requestClient.langHeader = key || DEFAULT_LANG_HEADER\n}\n\nrequestClient.setTenantHeader = (key: string | undefined) => {\n requestClient.tenantHeader = key || DEFAULT_LANG_HEADER\n}\n\nrequestClient.setTenantId = (tenantId: string) => {\n requestClient.tenantId = tenantId\n}\n","import {\n GuardMode,\n UserConfig,\n GuardScenes,\n LoginMethods,\n RegisterMethods,\n LocalesConfig,\n} from '../../components/AuthingGuard/types'\nimport { i18n } from './locales'\n\n// 个人版 OTP MFA 的 error code\nexport const OTP_MFA_CODE = 1635\n// 企业版手机和短信验证吗 MFA 的 error code\nexport const APP_MFA_CODE = 1636\n\n// 需要验证吗\nexport const NEED_CAPTCHA = 2000\n\nexport const LOGIN_METHODS_MAP = () => ({\n [LoginMethods.Password]: i18n.t('login.pwdLogin'),\n [LoginMethods.PhoneCode]: i18n.t('login.verifyCodeLogin'),\n [LoginMethods.AppQr]: i18n.t('login.appScanLogin'),\n [LoginMethods.WxMinQr]: i18n.t('login.scanLogin'),\n [LoginMethods.LDAP]: i18n.t('login.ldapLogin'),\n [LoginMethods.AD]: i18n.t('login.adLogin'),\n [LoginMethods.WechatMpQrcode]: i18n.t('login.wechatmpQrcode'),\n})\n\nexport const REGISTER_METHODS_MAP = () => ({\n [RegisterMethods.Email]: i18n.t('login.emailRegister'),\n [RegisterMethods.Phone]: i18n.t('login.phoneRegister'),\n})\n\n// 某些社会化登录会在 tabs 中显示,或者无法在 Guard 中使用,所以底部不显示了\nexport const HIDE_SOCIALS = [\n 'wechat:miniprogram:app-launch',\n 'wechat:miniprogram:qrconnect',\n 'wechat:webpage-authorization',\n 'wechat:miniprogram:default',\n 'wechatwork:addressbook',\n 'wechat:mobile',\n]\n\n// 企业版 MFA 支持的方式\nexport enum ApplicationMfaType {\n SMS = 'SMS',\n EMAIL = 'EMAIL',\n // OTP = 'OTP',\n // FACE = 'FACE',\n // FINGERPRINT = 'FINGERPRINT',\n}\n\nexport const defaultGuardConfig: Partial<UserConfig> = {\n isSSO: false,\n title: 'Authing',\n text: {\n loginTabs: LOGIN_METHODS_MAP(),\n loginBtn: {\n normal: '登录',\n loading: '登录',\n },\n registerBtn: {\n normal: '注册',\n loading: '注册',\n },\n },\n escCloseable: true,\n autoRegister: false,\n clickCloseable: true,\n mode: GuardMode.Normal,\n disableRegister: false,\n disableResetPwd: false,\n defaultScenes: GuardScenes.Login,\n appHost: 'https://core.authing.cn',\n defaultLoginMethod: LoginMethods.Password,\n defaultRegisterMethod: RegisterMethods.Email,\n loginMethods: [LoginMethods.Password, LoginMethods.PhoneCode],\n registerMethods: [RegisterMethods.Email, RegisterMethods.Phone],\n logo:\n 'https://files.authing.co/user-contents/photos/0a4c99ff-b8ce-4030-aaaf-584c807cb21c.png',\n passwordLoginMethods: [\n 'email-password',\n 'username-password',\n 'phone-password',\n ],\n}\n\nexport const defaultLocalesConfig: LocalesConfig = {\n defaultLang: 'zh-CN',\n isShowChange: false,\n}\n\nexport const defaultHeaders: {\n 'userpool-id': string\n 'app-id': string\n 'sdk-version': string\n 'request-from': string\n 'tenant-id': string\n lang: string\n} = {\n 'userpool-id': 'x-authing-userpool-id',\n 'app-id': 'x-authing-app-id',\n 'tenant-id': 'x-authing-app-tenant-id',\n 'request-from': 'x-authing-request-from',\n 'sdk-version': 'x-authing-sdk-version',\n lang: 'x-authing-lang',\n}\n","/**\n * 在屏幕中心弹出新窗口加载 url\n * @param url\n * @param param1\n */\nexport const popupCenter = (\n url: string,\n { w, h }: { w: number; h: number } = { w: 585, h: 649 }\n) => {\n // Fixes dual-screen position Most browsers Firefox\n const dualScreenLeft =\n window.screenLeft !== undefined ? window.screenLeft : window.screenX\n const dualScreenTop =\n window.screenTop !== undefined ? window.screenTop : window.screenY\n\n const width = window.innerWidth\n ? window.innerWidth\n : document.documentElement.clientWidth\n ? document.documentElement.clientWidth\n : window.screen.width\n const height = window.innerHeight\n ? window.innerHeight\n : document.documentElement.clientHeight\n ? document.documentElement.clientHeight\n : window.screen.height\n\n const systemZoom = width / window.screen.availWidth\n const left = (width - w) / 2 / systemZoom + dualScreenLeft\n const top = (height - h) / 2 / systemZoom + dualScreenTop\n const newWindow = window.open(\n url,\n '_blank',\n `\n toolbar=no,\n menubar=no,\n scrollbars=no,\n resizable=no,\n location=no,\n status=no\n width=${w / systemZoom}, \n height=${h / systemZoom}, \n top=${top}, \n left=${left}\n `\n )\n\n newWindow?.focus()\n}\n","import { useEffect } from 'react'\nimport { Rule } from 'antd/lib/form'\nimport { useGuardContext } from '../context/global/context'\nimport qs from 'qs'\n\nexport * from './popupCenter'\nexport * from './clipboard'\n\nexport const VALIDATE_PATTERN = {\n // https://emailregex.com/\n // eslint-disable-next-line no-control-regex\n email: /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,\n // 以下的来自 authing-user-portal 项目\n phone: /^1[3-9]\\d{9}$/,\n ip: /^((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})(\\.((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})){3}$/,\n host: /^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+.?$/,\n} as const\n\nexport const validate = (type: keyof typeof VALIDATE_PATTERN, val: string) => {\n return VALIDATE_PATTERN[type].test(val)\n}\n\nexport const getRequiredRules = (msg: string): Rule[] => {\n return [\n {\n required: true,\n message: msg,\n },\n ]\n}\n\nexport function getDeviceName() {\n if (typeof window === 'undefined') {\n return null\n }\n\n const userAgent = window.navigator.userAgent\n const platform = window.navigator.platform\n const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K']\n const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE']\n const iosPlatforms = ['iPhone', 'iPad', 'iPod']\n\n let os = null\n\n if (macosPlatforms.indexOf(platform) !== -1) {\n os = 'Mac OS'\n } else if (iosPlatforms.indexOf(platform) !== -1) {\n os = 'iOS'\n } else if (windowsPlatforms.indexOf(platform) !== -1) {\n os = 'Windows'\n } else if (/Android/.test(userAgent)) {\n os = 'Android'\n } else if (!os && /Linux/.test(platform)) {\n os = 'Linux'\n }\n\n return os\n}\n\nexport type STYLE_RECORD_KEY = 'appConfig' | 'userConfig'\n\n/**\n * 传对象 {'background-color': 'red'}\n * 传字符串 \"CSS 样式\"\n */\nconst insertedRecord: Record<STYLE_RECORD_KEY, any> = {\n appConfig: null,\n userConfig: null,\n}\nexport const insertStyles = (\n styles: string | any,\n recordKey: STYLE_RECORD_KEY\n) => {\n let styleElt, styleSheet\n if ((document as any).createStyleSheet) {\n // IE\n styleSheet = (document as any).createStyleSheet()\n } else {\n let head = document.getElementsByTagName('head')[0]\n styleElt = document.createElement('style')\n head.appendChild(styleElt)\n styleSheet = document.styleSheets[document.styleSheets.length - 1]\n }\n if (typeof styles === 'string') {\n if (styleElt) styleElt.innerHTML = styles\n else styleSheet.cssText = styles // IE\n } else {\n let i = 0\n for (let selector in styles) {\n if (styleSheet.insertRule) {\n let rule = selector + ' {' + styles[selector] + '}'\n styleSheet.insertRule(rule, i++)\n } else {\n styleSheet.addRule(selector, styles[selector], i++)\n }\n }\n }\n\n insertedRecord[recordKey] = styleElt\n}\n\nexport const removeStyles = (recordKey: STYLE_RECORD_KEY) => {\n if (!insertedRecord[recordKey]) {\n return\n }\n\n const styleElt = insertedRecord[recordKey]\n\n styleElt.parentNode?.removeChild(styleElt)\n\n insertedRecord[recordKey] = null\n}\n\nexport const useTitle = (title: string, prefix?: string) => {\n const {\n state: { config },\n } = useGuardContext()\n\n useEffect(() => {\n document.title = `${prefix ?? `${config.title} `} ${title}`\n }, [config.title, prefix, title])\n}\n\nexport const getClassnames = (classnames: (string | boolean | undefined)[]) => {\n return classnames.filter(Boolean).join(' ')\n}\n\n/**\n * https://www.itranslater.com/qa/details/2115518846294557696\n * Simple object check.\n * @param item\n * @returns {boolean}\n */\nexport function isObject(item: any) {\n return item && typeof item === 'object' && !Array.isArray(item)\n}\n\n/**\n * https://www.itranslater.com/qa/details/2115518846294557696\n * Deep merge two objects.\n * @param target\n * @param ...sources\n */\nexport function deepMerge<T extends any = any>(\n target: T,\n ...sources: any[]\n): T {\n if (!sources.length) return target\n const source = sources.shift()\n\n if (isObject(target) && isObject(source)) {\n for (const key in source) {\n if (isObject(source[key])) {\n // @ts-ignore\n if (!target[key]) {\n Object.assign(target, { [key]: {} })\n }\n // @ts-ignore\n deepMerge(target[key], source[key])\n } else {\n Object.assign(target, { [key]: source[key] })\n }\n }\n }\n\n return deepMerge(target, ...sources)\n}\n\nexport const getUserRegisterParams = () => {\n const query = qs.parse(window.location.search, {\n ignoreQueryPrefix: true,\n })\n return Object.keys(query).map((key) => ({\n key,\n value: query[key],\n }))\n}\n\nexport const isWechatBrowser = () =>\n /MicroMessenger/i.test(navigator?.userAgent)\n","export enum Steps {\n Verify,\n Reset,\n}\n","import React, { FC } from 'react'\nimport { Avatar } from 'antd'\n\nimport { useGuardContext } from '../../../context/global/context'\n\nimport './style.less'\n\nexport interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nexport const GuardHeader: FC<HeaderProps> = (props) => {\n const {\n state: {\n config: { logo, title, description },\n },\n } = useGuardContext()\n\n return (\n <div className=\"authing-guard-header\">\n {Boolean(logo) && (\n <Avatar className=\"authing-guard-logo\" src={logo} size={50}></Avatar>\n )}\n <div className=\"authing-guard-title-container\">\n <div className=\"authing-guard-title\">{title}</div>\n <div className=\"authing-guard-description\">{description}</div>\n </div>\n </div>\n )\n}\n","import { Button, Divider } from 'antd'\nimport React, { FC } from 'react'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { GuardScenes } from '../../../../components/AuthingGuard/types'\nimport './style.less'\nimport { useTranslation } from 'react-i18next'\n\nexport interface LoginFormFooterProps {\n loading: boolean\n needRestPwd?: boolean\n needRegister?: boolean\n}\n\nexport const LoginFormFooter: FC<LoginFormFooterProps> = ({\n loading,\n needRestPwd = false,\n needRegister = false,\n}) => {\n const { t } = useTranslation()\n\n const {\n setValue,\n state: { config },\n } = useGuardContext()\n\n return (\n <>\n <Button\n htmlType=\"submit\"\n className=\"authing-guard-form-submit-btn\"\n size=\"large\"\n type=\"primary\"\n loading={loading}\n block\n >\n {loading\n ? t(\n `map.${config.text?.loginBtn?.loading}`,\n config.text?.loginBtn?.loading\n )\n : t(\n `map.${config.text?.loginBtn?.normal}`,\n config.text?.loginBtn?.normal\n )}\n </Button>\n\n <div className=\"authing-guard-form-actions\">\n {needRestPwd && !config.disableResetPwd && (\n <Button\n onClick={() => setValue('guardScenes', GuardScenes.RestPassword)}\n className=\"authing-guard-text-btn\"\n type=\"text\"\n >\n {t('common.hasForgotPwd')}\n </Button>\n )}\n {needRestPwd &&\n needRegister &&\n !config.disableResetPwd &&\n !config.disableRegister && <Divider type=\"vertical\" />}\n {needRegister && !config.disableRegister && (\n <div className=\"authing-guard-tip-btn-comb\">\n <span className=\"authing-guard-tip\">{t('common.noAccYet')}</span>\n <Button\n onClick={() => setValue('guardScenes', GuardScenes.Register)}\n className=\"authing-guard-text-btn authing-guard-to-register-btn\"\n type=\"text\"\n >\n {t('common.registerImmediate')}\n </Button>\n </div>\n )}\n </div>\n </>\n )\n}\n","import { Input, Form, message } from 'antd'\nimport { FormInstance } from 'antd/lib/form'\nimport { UserOutlined, LockOutlined } from '@ant-design/icons'\nimport React, { forwardRef, useImperativeHandle, useState } from 'react'\n\nimport { getRequiredRules } from '../../../../utils'\nimport { useGuardContext } from '../../../../context/global/context'\nimport {\n ADLoginFormProps,\n LoginMethods,\n} from '../../../../components/AuthingGuard/types'\nimport { LoginFormFooter } from '../../../../components/AuthingGuard/Forms/LoginFormFooter'\nimport { useTranslation } from 'react-i18next'\n\nexport const ADLoginForm = forwardRef<FormInstance, ADLoginFormProps>(\n ({ onSuccess, onValidateFail, onFail }, ref) => {\n const { t } = useTranslation()\n const { state } = useGuardContext()\n const { authClient, guardEvents } = state\n\n const [loading, setLoading] = useState(false)\n\n const onFinishFailed = (errorInfo: any) => {\n setLoading(false)\n onValidateFail && onValidateFail(errorInfo)\n }\n\n const [rawForm] = Form.useForm()\n\n const onFinish = async (values: any) => {\n if (guardEvents.onBeforeLogin) {\n try {\n const canLogin = await guardEvents.onBeforeLogin(\n {\n type: LoginMethods.AD,\n data: {\n identity: values.identity,\n password: values.password,\n },\n },\n authClient\n )\n\n if (!canLogin) {\n setLoading(false)\n return\n }\n } catch (e) {\n if (typeof e === 'string') {\n message.error(e)\n } else {\n message.error(e.message)\n }\n setLoading(false)\n return\n }\n }\n\n try {\n const identity = values.identity && values.identity.trim()\n const password = values.password && values.password.trim()\n const user = await authClient.loginByAd(identity, password)\n onSuccess && onSuccess(user)\n } catch (error) {\n if (typeof error.message === 'string') {\n // js sdk httpclient 的报错,这里只有一种情况就是用户开启了 mfa 的报错\n try {\n const errorData = JSON.parse(error.message)\n onFail && onFail(errorData)\n return\n } catch (_) {\n // do nothing\n }\n }\n onFail && onFail(error)\n } finally {\n setLoading(false)\n }\n }\n\n useImperativeHandle(ref, () => rawForm)\n\n return (\n <Form\n form={rawForm}\n onSubmitCapture={() => setLoading(true)}\n onFinishFailed={onFinishFailed}\n onFinish={onFinish}\n >\n <Form.Item\n name=\"identity\"\n rules={getRequiredRules(t('login.inputAdUsername'))}\n >\n <Input\n autoComplete=\"email,username,tel\"\n size=\"large\"\n placeholder={t('login.inputAdUsername')}\n prefix={<UserOutlined style={{ color: '#ddd' }} />}\n />\n </Form.Item>\n <Form.Item\n name=\"password\"\n rules={getRequiredRules(t('login.inputAdPwd'))}\n >\n <Input.Password\n autoComplete=\"current-password\"\n size=\"large\"\n visibilityToggle={false}\n placeholder={t('login.inputAdPwd')}\n prefix={<LockOutlined style={{ color: '#ddd' }} />}\n />\n </Form.Item>\n <LoginFormFooter loading={loading}></LoginFormFooter>\n </Form>\n )\n }\n)\n","import React, { FC, useState } from 'react'\nimport { Form, Input, Button, message } from 'antd'\n\nimport { validate } from '../../../../utils'\nimport {\n ResetPasswordStep1Props,\n ResetPwdMethods,\n} from '../../../../components/AuthingGuard/types'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { EmailScene } from 'authing-js-sdk'\nimport { useTranslation } from 'react-i18next'\n\nexport const ResetPasswordStep1: FC<ResetPasswordStep1Props> = ({\n onSuccess,\n}) => {\n const {\n state: { authClient, guardEvents },\n } = useGuardContext()\n const { t } = useTranslation()\n\n const [loading, setLoading] = useState(false)\n\n const onFinish = async (values: any) => {\n const value = values.phoneOrEmail\n\n if (validate('email', value)) {\n try {\n setLoading(true)\n await authClient.sendEmail(value, EmailScene.ResetPassword)\n\n guardEvents.onPwdEmailSend?.(authClient)\n message.success(t('login.emailSent'))\n onSuccess(ResetPwdMethods.Email, value)\n } catch (e) {\n guardEvents.onPwdEmailSendError?.(e, authClient)\n } finally {\n setLoading(false)\n }\n } else if (validate('phone', value)) {\n onSuccess(ResetPwdMethods.Phone, value)\n }\n }\n\n return (\n <Form\n onSubmitCapture={() => setLoading(true)}\n onFinishFailed={() => setLoading(false)}\n onFinish={onFinish}\n >\n <Form.Item\n name=\"phoneOrEmail\"\n validateTrigger=\"onBlur\"\n rules={[\n {\n validator: (rule, value) => {\n if (!value) {\n return Promise.reject(t('login.inputPhoneOrEmail'))\n }\n if (validate('email', value) || validate('phone', value)) {\n return Promise.resolve()\n } else {\n return Promise.reject(t('login.inputCorrectPhone'))\n }\n },\n },\n ]}\n >\n <Input\n size=\"large\"\n autoComplete=\"tel,email\"\n placeholder={t('login.inputPhoneOrEmail')}\n />\n </Form.Item>\n <Button\n className=\"authing-reset-pwd-btn\"\n block\n type=\"primary\"\n size=\"large\"\n htmlType=\"submit\"\n loading={loading}\n >\n {t('login.resetPwd')}\n </Button>\n </Form>\n )\n}\n","import { Spin } from 'antd'\nimport React, { FC, useState, useRef, useEffect, useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { LoadingOutlined } from '@ant-design/icons'\n\nconst TIME = 60\nexport interface SendCodeProps {\n beforeSend: () => Promise<boolean>\n btnRef?: React.RefObject<HTMLButtonElement>\n}\n\nconst useSentCounter = () => {\n const [countDown, setCountDown] = useState(0)\n const timerRef = useRef<any>(0)\n\n useEffect(() => {\n return () => clearInterval(timerRef.current)\n }, [])\n\n useEffect(() => {\n if (countDown <= 0) {\n clearInterval(timerRef.current)\n }\n }, [countDown])\n\n const enabled = useMemo(() => countDown <= 0, [countDown])\n\n const send = () => {\n setCountDown(TIME)\n\n timerRef.current = setInterval(() => {\n setCountDown((prev) => {\n return prev - 1\n })\n }, 1000)\n }\n\n return {\n enabled,\n send,\n countDown,\n }\n}\n\nexport const SendCodeBtn: FC<SendCodeProps> = ({ beforeSend, btnRef }) => {\n const { enabled, send, countDown } = useSentCounter()\n const [loading, setLoading] = useState(false)\n const { t } = useTranslation()\n const disabled = useMemo(() => {\n return !enabled || loading\n }, [enabled, loading])\n\n const onClick = async (e: React.MouseEvent<HTMLButtonElement>) => {\n setLoading(true)\n if (disabled) {\n return\n }\n\n if (!(await beforeSend())) {\n setLoading(false)\n return\n }\n setLoading(false)\n send()\n }\n\n return (\n <button\n type=\"button\"\n className=\"authing-send-code-btn\"\n disabled={disabled}\n onClick={onClick}\n ref={btnRef}\n >\n <Spin\n spinning={loading}\n indicator={<LoadingOutlined spin />}\n size=\"small\"\n >\n {enabled\n ? t('common.sendVerifyCode')\n : t('common.retryAfterTime', {\n time: countDown,\n })}\n </Spin>\n </button>\n )\n}\n","import { message } from 'antd'\nimport React, { FC } from 'react'\nimport { CommonMessage } from 'authing-js-sdk'\n\nimport { SendCodeBtn } from './SendCodeBtn'\nimport { validate } from '../../../../utils'\nimport { useGuardContext } from '../../../../context/global/context'\n\nimport './style.less'\nimport { useTranslation } from 'react-i18next'\n\nexport interface SendPhoneCodeProps {\n phone: string\n onSend?: () => void\n onError?: (error: CommonMessage) => void\n}\n\nexport const SendPhoneCode: FC<SendPhoneCodeProps> = ({\n phone,\n onSend,\n onError,\n}) => {\n const { t } = useTranslation()\n const {\n state: { authClient },\n } = useGuardContext()\n\n return (\n <SendCodeBtn\n beforeSend={async () => {\n if (!phone) {\n message.error(t('login.inputPhone'))\n return false\n }\n if (!validate('phone', phone)) {\n message.error(t('common.phoneFormateError'))\n return false\n }\n try {\n await authClient.sendSmsCode(phone)\n onSend?.()\n return true\n } catch (error) {\n onError?.(error)\n return false\n }\n }}\n />\n )\n}\n","import React, { FC, useState } from 'react'\nimport { Form, Input, Button } from 'antd'\nimport { SafetyOutlined, LockOutlined, UserOutlined } from '@ant-design/icons'\n\nimport { getRequiredRules } from '../../../../utils'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { ResetPasswordStep2Props } from '../../../../components/AuthingGuard/types'\nimport { SendPhoneCode } from '../../../../components/AuthingGuard/Forms/SendPhoneCode'\nimport { useTranslation } from 'react-i18next'\n\nexport const ResetPasswordStep2: FC<ResetPasswordStep2Props> = ({\n phone,\n onSuccess,\n onFail,\n}) => {\n const [rawForm] = Form.useForm()\n const { t } = useTranslation()\n\n const [loading, setLoading] = useState(false)\n\n const {\n state: { authClient, guardEvents },\n } = useGuardContext()\n\n const onStep2Finish = async (values: any) => {\n const code = values.code\n const password = values.password\n\n try {\n await authClient.resetPasswordByPhoneCode(phone, code, password)\n onSuccess()\n } catch (e) {\n onFail?.(e)\n } finally {\n setLoading(false)\n }\n }\n\n return (\n <Form\n form={rawForm}\n onFinishFailed={() => setLoading(false)}\n onSubmitCapture={() => setLoading(true)}\n onFinish={onStep2Finish}\n >\n <Form.Item\n name=\"phone\"\n initialValue={phone}\n rules={getRequiredRules(t('common.phoneNotNull'))}\n >\n <Input\n autoComplete=\"tel\"\n name=\"phone\"\n readOnly\n size=\"large\"\n placeholder={t('login.inputPhone')}\n prefix={<UserOutlined style={{ color: '#ddd' }} />}\n />\n </Form.Item>\n <Form.Item\n name=\"code\"\n rules={getRequiredRules(t('common.inputVerifyCode')).concat({\n len: 4,\n message: t('common.inputFourVerifyCode', {\n length: 4,\n }),\n })}\n >\n <Input\n name=\"code\"\n size=\"large\"\n placeholder={t('common.inputFourVerifyCode', {\n length: 4,\n })}\n prefix={<SafetyOutlined style={{ color: '#ddd' }} />}\n suffix={\n <SendPhoneCode\n onError={(error) =>\n guardEvents.onPwdPhoneSendError?.(error, authClient)\n }\n onSend={() => guardEvents.onPwdPhoneSend?.(authClient)}\n phone={phone}\n />\n }\n />\n </Form.Item>\n <Form.Item\n name=\"password\"\n rules={getRequiredRules(t('common.passwordNotNull'))}\n >\n <Input.Password\n name=\"password\"\n size=\"large\"\n placeholder={t('user.newPwd')}\n prefix={<LockOutlined style={{ color: '#ddd' }} />}\n />\n </Form.Item>\n <Form.Item\n name=\"repeat-password\"\n rules={getRequiredRules(t('common.repeatPassword')).concat({\n validator: async (rule, value) => {\n if (rawForm.getFieldValue('password') !== value) {\n throw new Error(t('login.twoPwdNeedSame'))\n }\n },\n })}\n >\n <Input.Password\n name=\"repeat-password\"\n size=\"large\"\n placeholder={t('login.inputPwdAgain')}\n prefix={<LockOutlined style={{ color: '#ddd' }} />}\n />\n </Form.Item>\n <Button\n className=\"authing-reset-pwd-btn\"\n block\n loading={loading}\n type=\"primary\"\n size=\"large\"\n htmlType=\"submit\"\n >\n {t('login.resetPwd')}\n </Button>\n </Form>\n )\n}\n","import React, { FC, useState } from 'react'\nimport { Form, Button, Input, message } from 'antd'\nimport { SafetyOutlined, LockOutlined } from '@ant-design/icons'\nimport { EmailScene } from 'authing-js-sdk'\n\nimport { getRequiredRules } from '../../../../utils'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { ResetPasswordStep3Props } from '../../../../components/AuthingGuard/types'\nimport { useTranslation } from 'react-i18next'\n\nexport const ResetPasswordStep3: FC<ResetPasswordStep3Props> = ({\n email,\n onSuccess = () => {},\n onFail,\n}) => {\n const {\n state: { authClient, guardEvents },\n } = useGuardContext()\n const [rawForm] = Form.useForm()\n const { t } = useTranslation()\n\n const [reseting, setReseting] = useState(false)\n const [sending, setSending] = useState(false)\n\n const onSendResetMail = async () => {\n setSending(true)\n try {\n await authClient.sendEmail(email, EmailScene.ResetPassword)\n message.success(t('login.emailSent'))\n guardEvents.onPwdEmailSend?.(authClient)\n } catch (e) {\n guardEvents.onPwdEmailSendError?.(e, authClient)\n } finally {\n setSending(false)\n }\n }\n\n const onStep3Finish = async (values: any) => {\n const code = values.code\n const password = values.password\n try {\n await authClient.resetPasswordByEmailCode(email, code, password)\n onSuccess()\n } catch (error) {\n onFail?.(error)\n } finally {\n setReseting(false)\n }\n }\n\n return (\n <>\n <p\n style={{\n marginBottom: 24,\n padding: '0 12px',\n }}\n >\n {t('login.resetEmailSent', {\n email: email,\n })}\n </p>\n\n <Form\n form={rawForm}\n onFinishFailed={() => setReseting(false)}\n onSubmitCapture={() => setReseting(true)}\n onFinish={onStep3Finish}\n >\n <Form.Item\n name=\"code\"\n rules={getRequiredRules(t('common.repeatPassword')).concat({\n len: 4,\n message: t('common.inputFourVerifyCode', {\n length: 4,\n }),\n })}\n >\n <Input\n name=\"code\"\n size=\"large\"\n placeholder={t('login.fourVerifyCode', {\n length: 4,\n })}\n prefix={<SafetyOutlined style={{ color: '#ddd' }} />}\n />\n </Form.Item>\n <Form.Item\n name=\"password\"\n rules={getRequiredRules(t('common.passwordNotNull'))}\n >\n <Input.Password\n name=\"password\"\n size=\"large\"\n placeholder={t('user.newPwd')}\n prefix={<LockOutlined style={{ color: '#ddd' }} />}\n />\n </Form.Item>\n <Form.Item\n name=\"repeat-password\"\n rules={getRequiredRules(t('common.repeatPassword')).concat({\n validator: async (rule, value) => {\n if (rawForm.getFieldValue('password') !== value) {\n throw new Error(t('login.twoPwdNeedSame'))\n }\n },\n })}\n >\n <Input.Password\n name=\"repeat-password\"\n size=\"large\"\n placeholder={t('login.inputPwdAgain')}\n prefix={<LockOutlined style={{ color: '#ddd' }} />}\n />\n </Form.Item>\n <Form.Item>\n <Button\n className=\"authing-reset-pwd-btn\"\n block\n loading={reseting}\n type=\"primary\"\n size=\"large\"\n htmlType=\"submit\"\n >\n {t('login.resetPwd')}\n </Button>\n </Form.Item>\n <Button\n block\n type=\"primary\"\n ghost\n loading={sending}\n size=\"large\"\n onClick={onSendResetMail}\n >\n {t('login.resetPwdEmail')}\n </Button>\n </Form>\n </>\n )\n}\n","import { useGuardContext } from '../../../../context/global/context'\nimport React, { FC, useEffect, useRef, useState } from 'react'\n\nimport { GuardScenes } from '../../../../components/AuthingGuard/types'\nimport { useTranslation } from 'react-i18next'\n\nconst TIME = 3\nexport const ResetPasswordStep4: FC = () => {\n const [countDown, setCountDown] = useState(TIME)\n const timerRef = useRef<any>(0)\n const { t } = useTranslation()\n const { setValue } = useGuardContext()\n\n useEffect(() => {\n timerRef.current = setInterval(() => {\n setCountDown((prev) => {\n return prev - 1\n })\n }, 1000)\n\n return () => clearInterval(timerRef.current)\n }, [])\n\n useEffect(() => {\n if (countDown <= 0) {\n clearInterval(timerRef.current)\n\n setValue('guardScenes', GuardScenes.Login)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [countDown])\n\n return (\n <div style={{ textAlign: 'center' }}>\n <h3\n style={{\n fontSize: 20,\n fontFamily: 'PingFangSC-Medium',\n marginBottom: 0,\n }}\n >\n {t('common.pwdModifySuccess')}\n </h3>\n <p style={{ fontSize: 12 }}>\n {t('common.jumpAfterCount', {\n number: countDown,\n })}\n </p>\n </div>\n )\n}\n","import React from 'react'\nimport { Button } from 'antd'\n\nimport { useGuardContext } from '../../../../context/global/context'\nimport { GuardScenes } from '../../../../components/AuthingGuard/types'\nimport { useTranslation } from 'react-i18next'\n\nexport const ResetPwdFormFooter = () => {\n const { setValue } = useGuardContext()\n const { t } = useTranslation()\n return (\n <Button\n onClick={() => setValue('guardScenes', GuardScenes.Login)}\n className=\"authing-guard-text-btn authing-guard-form-actions\"\n type=\"text\"\n htmlType=\"button\"\n >\n {t('login.otherAccLogin')}\n </Button>\n )\n}\n","import React, { FC, useEffect, useState } from 'react'\n\nimport { ResetPasswordStep1 } from './Step1'\nimport { ResetPasswordStep2 } from './Step2'\nimport { ResetPasswordStep3 } from './Step3'\nimport { ResetPasswordStep4 } from './Step4'\nimport { ResetPwdFormFooter } from './Footer'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { ResetPasswordFormProps } from '../../../../components/AuthingGuard/types'\n\nimport './style.less'\nimport { useTranslation } from 'react-i18next'\n\nexport const ResetPasswordForm: FC<ResetPasswordFormProps> = ({\n onSuccess,\n onFail,\n}) => {\n const { setValue } = useGuardContext()\n const { t } = useTranslation()\n\n const [step, setStep] = useState(1)\n const [phone, setPhone] = useState('')\n const [email, setEmail] = useState('')\n\n useEffect(() => {\n switch (step) {\n case 1:\n setValue('guardTitle', t('common.retrievePassword'))\n break\n case 2:\n case 3:\n case 4:\n setValue('guardTitle', t('login.resetPwd'))\n break\n default:\n setValue('guardTitle', t('common.retrievePassword'))\n break\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [step])\n\n const onStep1Finish = async (type: string, value: string) => {\n if (type === 'phone') {\n setPhone(value)\n setStep(2)\n } else if (type === 'email') {\n setEmail(value)\n setStep(3)\n }\n }\n\n const onStep2OrStep3Finish = () => {\n setStep(4)\n onSuccess?.()\n }\n\n const onStep2OrStep3Fail = (error: any) => {\n onFail?.(error)\n }\n\n const getForm = () => {\n switch (step) {\n case 1:\n return (\n <ResetPasswordStep1 onSuccess={onStep1Finish}></ResetPasswordStep1>\n )\n case 2:\n return (\n <ResetPasswordStep2\n phone={phone}\n onFail={onStep2OrStep3Fail}\n onSuccess={onStep2OrStep3Finish}\n ></ResetPasswordStep2>\n )\n case 3:\n return (\n <ResetPasswordStep3\n email={email}\n onFail={onStep2OrStep3Fail}\n onSuccess={onStep2OrStep3Finish}\n ></ResetPasswordStep3>\n )\n case 4:\n return <ResetPasswordStep4></ResetPasswordStep4>\n default:\n return null\n }\n }\n\n return (\n <div>\n {getForm()}\n {step !== 4 && <ResetPwdFormFooter />}\n </div>\n )\n}\n","import { Divider, Input } from 'antd'\nimport React, { FC, Fragment, useRef } from 'react'\n\nimport './style.less'\n\ninterface VerifyCodeInputProps extends React.HTMLAttributes<HTMLDivElement> {\n verifyCode: string[]\n setVerifyCode: (code: string[]) => void\n length?: number\n onEnter?: Function\n}\n\nexport const VerifyCodeInput: FC<VerifyCodeInputProps> = ({\n verifyCode,\n setVerifyCode,\n length = 6,\n onEnter,\n}) => {\n const inputRef = useRef<any[]>([])\n\n const handleChange = (val: string | undefined = '', index: number) => {\n const num = parseInt(val)\n if (isNaN(num)) {\n val = ''\n } else {\n val = String(num)\n }\n const codes = [...verifyCode]\n codes[index] = val.split('').slice(-1)[0] || ''\n setVerifyCode(codes)\n\n if (val && inputRef.current[index + 1]) {\n inputRef.current[index + 1].focus()\n }\n }\n\n const handleKeyDown = (evt: any, index: number) => {\n const currentVal = verifyCode[index]\n\n switch (evt.keyCode) {\n case 8:\n if (!currentVal && inputRef.current[index - 1]) {\n handleChange('', index - 1)\n inputRef.current[index - 1].focus()\n }\n break\n\n case 13:\n onEnter?.()\n break\n default:\n break\n }\n }\n\n return (\n <div className=\"authing-code-input\">\n {new Array(length).fill(0).map((_, index) => (\n <Fragment key={index}>\n <Input\n ref={(el) => (inputRef.current[index] = el)}\n className=\"authing-code-input-item\"\n size=\"large\"\n autoFocus={index === 0}\n onKeyDown={(evt) => handleKeyDown(evt, index)}\n value={verifyCode[index]}\n onChange={(evt) => handleChange(evt.target.value, index)}\n />\n {index === Math.floor(length / 2 - 1) && (\n <Divider className=\"authing-code-input-divider\" />\n )}\n </Fragment>\n ))}\n </div>\n )\n}\n","import { User } from 'authing-js-sdk'\nimport React, { FC, useState } from 'react'\nimport { Button, Form } from 'antd'\n\nimport { VerifyCodeInput } from '../../../../common/VerifyCodeInput'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { MfaVerifyForm } from '../../../../components/AuthingGuard/types'\n\nimport './style.less'\nimport { useTranslation } from 'react-i18next'\n\nconst CODE_LEN = 6\n\nexport const MFAVerifyForm: FC<MfaVerifyForm> = ({\n onSuccess,\n onFail,\n goReset,\n}) => {\n const {\n state: {\n authClient,\n mfaData: { mfaToken },\n },\n } = useGuardContext()\n\n const { t } = useTranslation()\n\n const [rawForm] = Form.useForm()\n\n const [MfaCode, setMFACode] = useState(new Array(CODE_LEN).fill(''))\n const [loading, setLoading] = useState(false)\n\n const onFinish = async (values: any) => {\n try {\n const user: User = await authClient.mfa.verifyTotpMfa({\n mfaToken,\n totp: MfaCode.join(''),\n })\n onSuccess && onSuccess(user)\n } catch (e) {\n onFail?.(e)\n } finally {\n setLoading(false)\n }\n }\n\n return (\n <>\n <h3 className=\"authing-guard-mfa-title\">\n {t('login.accPwdLoginVerify')}\n </h3>\n <p className=\"authing-guard-mfa-tips\">{t('login.inputSixCode')}</p>\n <Form\n form={rawForm}\n onSubmitCapture={() => setLoading(true)}\n onFinish={onFinish}\n onFinishFailed={() => setLoading(false)}\n >\n <Form.Item\n name=\"mfaCode\"\n rules={[\n {\n validateTrigger: [],\n validator() {\n if (MfaCode.some((item) => !item)) {\n return Promise.reject(t('login.inputFullMfaCode'))\n }\n return Promise.resolve()\n },\n },\n ]}\n >\n <VerifyCodeInput verifyCode={MfaCode} setVerifyCode={setMFACode} />\n </Form.Item>\n\n <Button\n className=\"authing-guard-mfa-confirm-btn\"\n loading={loading}\n block\n htmlType=\"submit\"\n type=\"primary\"\n size=\"large\"\n >\n {t('common.sure')}\n </Button>\n\n <div className=\"authing-guard-form-actions\">\n <div className=\"authing-guard-tip-btn-comb\">\n <span className=\"authing-guard-tip\">\n {t('common.hasLooseSaftyCode')}\n </span>\n <Button\n htmlType=\"button\"\n onClick={goReset}\n className=\"authing-guard-text-btn\"\n type=\"text\"\n >\n {t('common.useRecoverCode')}\n </Button>\n </div>\n </div>\n </Form>\n </>\n )\n}\n","import { Input, Form, message } from 'antd'\nimport { FormInstance } from 'antd/lib/form'\nimport { UserOutlined, LockOutlined } from '@ant-design/icons'\nimport React, { forwardRef, useImperativeHandle, useState } from 'react'\n\nimport { getRequiredRules } from '../../../../utils'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { NEED_CAPTCHA } from '../../../../components/AuthingGuard/constants'\nimport {\n LoginMethods,\n PasswordLoginFormProps,\n} from '../../../../components/AuthingGuard/types'\nimport { LoginFormFooter } from '../../../../components/AuthingGuard/Forms/LoginFormFooter'\nimport { useTranslation } from 'react-i18next'\n\nexport const LdapLoginForm = forwardRef<FormInstance, PasswordLoginFormProps>(\n ({ onSuccess, onValidateFail, onFail }, ref) => {\n const { t } = useTranslation()\n\n const { state } = useGuardContext()\n const { config, authClient, realHost, guardEvents } = state\n const autoRegister = config.autoRegister\n\n const [rawForm] = Form.useForm()\n\n const [needCaptcha, setNeedCaptcha] = useState(false)\n const [verifyCodeUrl, setVerifyCodeUrl] = useState<string | null>(null)\n const [loading, setLoading] = useState(false)\n\n const captchaUrl = `${realHost}/api/v2/security/captcha`\n const getCaptchaUrl = () => `${captchaUrl}?r=${+new Date()}`\n\n const onFinishFailed = (errorInfo: any) => {\n setLoading(false)\n onValidateFail && onValidateFail(errorInfo)\n }\n\n const onFinish = async (values: any) => {\n if (guardEvents.onBeforeLogin) {\n try {\n const canLogin = await guardEvents.onBeforeLogin(\n {\n type: LoginMethods.LDAP,\n data: {\n identity: values.identity,\n password: values.password,\n captchaCode: values.captchaCode,\n },\n },\n authClient\n )\n\n if (!canLogin) {\n setLoading(false)\n return\n }\n } catch (e) {\n if (typeof e === 'string') {\n message.error(e)\n } else {\n message.error(e.message)\n }\n setLoading(false)\n return\n }\n }\n\n try {\n const identity = values.identity && values.identity.trim()\n const password = values.password && values.password.trim()\n const captchaCode = values.captchaCode && values.captchaCode.trim()\n\n const user = await authClient.loginByLdap(identity, password, {\n autoRegister,\n captchaCode,\n })\n onSuccess && onSuccess(user)\n } catch (error) {\n if (typeof error.message === 'string') {\n // js sdk httpclient 的报错,这里只有一种情况就是用户开启了 mfa 的报错\n try {\n const errorData = JSON.parse(error.message)\n onFail && onFail(errorData)\n return\n } catch (_) {}\n }\n\n if (error.code === NEED_CAPTCHA && verifyCodeUrl === null) {\n setNeedCaptcha(true)\n setVerifyCodeUrl(getCaptchaUrl())\n }\n\n onFail && onFail(error)\n } finally {\n setLoading(false)\n }\n }\n\n useImperativeHandle(ref, () => rawForm)\n\n const formItems = [\n {\n component: (\n <Input\n autoComplete=\"ldap,username\"\n size=\"large\"\n placeholder={t('login.inputLdapUsername')}\n prefix={<UserOutlined style={{ color: '#ddd' }} />}\n />\n ),\n name: 'identity',\n rules: getRequiredRules(t('common.LDAPAccountNotNull')),\n },\n {\n component: (\n <Input.Password\n size=\"large\"\n placeholder={t('login.inputLdapPwd')}\n prefix={<LockOutlined style={{ color: '#ddd' }} />}\n />\n ),\n name: 'password',\n rules: getRequiredRules(t('common.passwordNotNull')),\n },\n {\n component: (\n <Input\n size=\"large\"\n placeholder={t('login.inputCaptchaCode')}\n addonAfter={\n <img\n src={verifyCodeUrl ?? ''}\n alt={t('login.captchaCode')}\n style={{ height: '2em', cursor: 'pointer' }}\n onClick={() => setVerifyCodeUrl(getCaptchaUrl())}\n />\n }\n />\n ),\n name: 'captchaCode',\n rules: getRequiredRules(t('common.captchaCodeNotNull')),\n hide: !needCaptcha,\n },\n ]\n\n return (\n <Form\n form={rawForm}\n onSubmitCapture={() => setLoading(true)}\n onFinishFailed={onFinishFailed}\n onFinish={onFinish}\n >\n {formItems.map(\n (item) =>\n !item.hide && (\n <Form.Item key={item.name} name={item.name} rules={item.rules}>\n {item.component}\n </Form.Item>\n )\n )}\n\n <LoginFormFooter loading={loading}></LoginFormFooter>\n </Form>\n )\n }\n)\n","import { Spin } from 'antd'\nimport React, { FC, useEffect, useMemo, useRef } from 'react'\n\nimport { useGuardContext } from '../../../../context/global/context'\nimport {\n LoginMethods,\n QrLoginFormProps,\n} from '../../../../components/AuthingGuard/types'\n\nimport './style.less'\nimport { User } from 'authing-js-sdk'\n\nexport const QrCodeLoginForm: FC<QrLoginFormProps> = ({\n onFail,\n onSuccess,\n type,\n idpId,\n}) => {\n const {\n state: { authClient, config },\n } = useGuardContext()\n\n const timerRef = useRef<any>()\n\n const client = useMemo(() => {\n return {\n [LoginMethods.AppQr]: authClient.qrcode,\n [LoginMethods.WxMinQr]: authClient.wxqrcode,\n [LoginMethods.WechatMpQrcode]: authClient.wechatmpqrcode,\n }[type]\n }, [type, authClient])\n\n useEffect(() => {\n client.startScanning('authingGuardQrcode', {\n extIdpConnId: idpId,\n autoExchangeUserInfo: true,\n ...config.qrCodeScanOptions,\n onStart(timer) {\n timerRef.current = timer\n },\n onSuccess(user) {\n onSuccess && onSuccess(user as User)\n },\n onError: (message) => {\n config.qrCodeScanOptions?.onError?.(message)\n\n onFail && onFail(`${message}`)\n },\n })\n return () => clearInterval(timerRef.current)\n }, [client, config.qrCodeScanOptions, idpId, onFail, onSuccess])\n\n return (\n <div className=\"authing-guard-qr-form\">\n <div className=\"authing-guard-qr-loading\">\n <Spin size=\"large\" />\n </div>\n <div id=\"authingGuardQrcode\"></div>\n </div>\n )\n}\n","import { Input, Form, Button } from 'antd'\nimport React, { FC, useState } from 'react'\nimport { LockOutlined } from '@ant-design/icons'\nimport { getRequiredRules } from '../../../../utils'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { User } from 'authing-js-sdk'\nimport { useTranslation } from 'react-i18next'\n\nexport const MfaResetStep1: FC<{\n mfaToken: string\n onSuccess: (\n user: User & {\n recoveryCode: string\n }\n ) => void\n goVerify: () => void\n onFail?: (error: any) => void\n}> = ({ mfaToken, onSuccess, goVerify, onFail }) => {\n const [loading, setLoading] = useState(false)\n const { t } = useTranslation()\n\n const {\n state: { authClient },\n } = useGuardContext()\n\n const onFinish = async (values: any) => {\n try {\n const user = await authClient.mfa.verifyTotpRecoveryCode({\n recoveryCode: values.recoverCode,\n mfaToken,\n })\n onSuccess(\n user as User & {\n recoveryCode: string\n }\n )\n } catch (e) {\n onFail?.(e)\n } finally {\n setLoading(false)\n }\n }\n\n return (\n <Form\n onSubmitCapture={() => setLoading(true)}\n onFinishFailed={() => setLoading(false)}\n onFinish={onFinish}\n >\n <Form.Item\n rules={getRequiredRules(t('common.recoverCodeNotNull'))}\n name=\"recoverCode\"\n >\n <Input\n prefix={<LockOutlined style={{ color: '#ddd' }} />}\n placeholder={t('login.inputRecoverCode')}\n size=\"large\"\n ></Input>\n </Form.Item>\n\n <Button\n className=\"authing-guard-mfa-confirm-btn\"\n loading={loading}\n htmlType=\"submit\"\n block\n type=\"primary\"\n size=\"large\"\n >\n {t('common.sure')}\n </Button>\n\n <div className=\"authing-guard-form-actions\">\n <div className=\"authing-guard-tip-btn-comb\">\n <Button\n htmlType=\"button\"\n onClick={goVerify}\n className=\"authing-guard-text-btn\"\n type=\"text\"\n >\n {t('login.findedSafetyCode')}\n </Button>\n </div>\n </div>\n </Form>\n )\n}\n","import React, { FC, useCallback, useEffect, useRef, useState } from 'react'\nimport { CopyOutlined, CheckOutlined } from '@ant-design/icons'\nimport { copyToClipboard, getClassnames } from '../../utils'\n\nimport './style.less'\nimport { useTranslation } from 'react-i18next'\n\nexport interface CopyTextProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nexport const CopyAbleText: FC<CopyTextProps> = ({ children, className }) => {\n const { t } = useTranslation()\n const divRef = useRef<HTMLDivElement>(null)\n const [copied, setCopied] = useState(false)\n const timer = useRef(-1)\n\n const startTimer = useCallback(() => {\n setCopied(true)\n clearTimeout(timer.current)\n timer.current = (setTimeout(\n () => setCopied(false),\n 3000\n ) as unknown) as number\n }, [timer])\n\n useEffect(() => {\n return () => clearTimeout(timer.current)\n }, [])\n\n const handleCopy = () => {\n copyToClipboard(divRef.current!.innerText)\n startTimer()\n }\n\n return (\n <div\n className={getClassnames(['authing-copy-text', className])}\n ref={divRef}\n >\n {children}\n {copied ? (\n <CheckOutlined\n className=\"authing-data-tips authing-data-tips__top authing-guard-pointer authing-copy-text-icon authing-copy-text-icon__success\"\n data-tips={t('common.copied')}\n />\n ) : (\n <CopyOutlined\n className=\"authing-data-tips authing-data-tips__top authing-guard-pointer authing-copy-text-icon\"\n data-tips={t('common.copy')}\n onClick={handleCopy}\n />\n )}\n </div>\n )\n}\n","import { i18n } from 'src/components/AuthingGuard/locales'\n\n// https://juejin.im/post/6844903857290477582\nexport const copyToClipboard = (str: string) => {\n const el = document.createElement('textarea') // 创建一个 <textarea> 元素\n el.value = str // 设置它的值为你想复制的字符串\n el.setAttribute('readonly', '') // 设置为只读以防止干扰\n el.style.position = 'absolute'\n el.style.left = '-9999px' // 移出屏幕外以使其不可见\n document.body.appendChild(el) // 插入 <textarea> 元素到 HTML 文档中\n try {\n const selected =\n document.getSelection()!.rangeCount > 0 // 检查是否之前曾选中过内容\n ? document.getSelection()!.getRangeAt(0) // 如果找到,则保存选中\n : false // 标记为 false 以表示不存在之前选中的内容\n el.select() // 选中 <textarea> 的内容\n document.execCommand('copy') // 复制 - 仅当作为用户操作的响应结果时才可以工作(比如,点击事件)\n document.body.removeChild(el) // 移除 <textarea> 元素\n if (selected) {\n // 如果在复制前已存在选中的内容\n document.getSelection()!.removeAllRanges() // 取消 HTML 文档中所有的选中部分\n document.getSelection()!.addRange(selected) // 恢复原来的选中\n }\n } catch (e) {\n console.warn(i18n.t('common.copyFailed'))\n }\n}\n","import React, { FC } from 'react'\n\nimport { Button, Checkbox, Form } from 'antd'\nimport { CopyAbleText } from '../../../../common/CopyAbleText'\nimport { useTranslation } from 'react-i18next'\n\nexport interface MfaResetStep2Props {\n recoverCode: string\n onFinish: () => void\n}\n\nexport const MfaResetStep2: FC<MfaResetStep2Props> = ({\n recoverCode,\n onFinish,\n}) => {\n const { t } = useTranslation()\n return (\n <Form onFinish={onFinish}>\n <CopyAbleText className=\"authing-guard-secret-block\">\n {recoverCode}\n </CopyAbleText>\n <Form.Item\n valuePropName=\"checked\"\n rules={[\n {\n validateTrigger: [],\n validator(r, v) {\n return new Promise((resolve, reject) => {\n if (!v) {\n reject(t('login.confirmSavedCode'))\n }\n resolve(true)\n })\n },\n },\n ]}\n name=\"MfaCopyRecoverCode\"\n >\n <Checkbox>{t('login.rememberedSecret')}</Checkbox>\n </Form.Item>\n\n <Button\n className=\"authing-guard-mfa-confirm-btn\"\n htmlType=\"submit\"\n block\n type=\"primary\"\n size=\"large\"\n >\n {t('common.sure')}\n </Button>\n </Form>\n )\n}\n","import { User } from 'authing-js-sdk'\nimport React, { FC, useState } from 'react'\n\nimport { MfaResetStep1 } from './Step1'\nimport { MfaResetStep2 } from './Step2'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { MfaResetForm } from '../../../../components/AuthingGuard/types'\n\nimport './style.less'\nimport { useTranslation } from 'react-i18next'\n\nexport const MfaResetCodeForm: FC<MfaResetForm> = ({\n goVerify,\n onSuccess,\n onFail,\n}) => {\n const { t } = useTranslation()\n\n const {\n state: {\n mfaData: { mfaToken },\n },\n } = useGuardContext()\n\n const [step, setStep] = useState(1)\n const [user, setUser] = useState<User | null>(null)\n const [recoverCode, setRecoverCode] = useState('')\n\n const onReset = (\n user: User & {\n recoveryCode: string\n }\n ) => {\n setStep(2)\n setUser(user)\n setRecoverCode(user.recoveryCode)\n }\n\n const stepMap: Record<number, JSX.Element | undefined> = {\n 1: (\n <MfaResetStep1\n onFail={onFail}\n goVerify={goVerify}\n onSuccess={onReset}\n mfaToken={mfaToken}\n />\n ),\n 2: (\n <MfaResetStep2\n onFinish={() => onSuccess?.(user!)}\n recoverCode={recoverCode}\n />\n ),\n }\n\n return (\n <>\n <h2 className=\"authing-guard-mfa-reset-title\">\n {t('common.useRecoverCode')}\n </h2>\n <p className=\"authing-guard-mfa-reset-tips\">{t('login.mfaAfterReset')}</p>\n {stepMap[step]}\n </>\n )\n}\n","import { Button } from 'antd'\nimport React, { FC } from 'react'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { GuardScenes } from '../../../../components/AuthingGuard/types'\n\nimport './style.less'\nimport { useTranslation } from 'react-i18next'\n\nexport interface RegisterFormFooterProps {\n loading: boolean\n}\n\nexport const RegisterFormFooter: FC<RegisterFormFooterProps> = ({\n loading,\n}) => {\n const {\n setValue,\n state: { config },\n } = useGuardContext()\n const { t } = useTranslation()\n\n return (\n <>\n <Button\n htmlType=\"submit\"\n size=\"large\"\n type=\"primary\"\n loading={loading}\n block\n >\n {loading\n ? t(\n `map.${config.text?.registerBtn?.loading}`,\n config.text?.registerBtn?.loading\n )\n : t(\n `map.${config.text?.registerBtn?.normal}`,\n config.text?.registerBtn?.normal\n )}\n </Button>\n\n <div className=\"authing-guard-form-actions\">\n <div className=\"authing-guard-tip-btn-comb\">\n <span className=\"authing-guard-tip\">{t('common.alreadyHasAcc')}</span>\n <Button\n onClick={() => setValue('guardScenes', GuardScenes.Login)}\n className=\"authing-guard-text-btn authing-guard-to-login-btn\"\n type=\"text\"\n >\n {t('common.loginImmediate')}\n </Button>\n </div>\n </div>\n </>\n )\n}\n","import React, { FC, useState, useMemo, useEffect } from 'react'\nimport { Space, Checkbox } from 'antd'\nimport { Agreement } from '../../api'\nimport { getClassnames } from '../../../../utils'\nimport './style.less'\n\nexport interface AgreementsProps {\n value?: boolean\n onChange?: (value: boolean) => void\n style?: React.CSSProperties\n agreements: Agreement[]\n showError?: boolean\n}\n\nexport const Agreements: FC<AgreementsProps> = ({\n showError,\n onChange = () => {},\n style,\n agreements,\n}) => {\n const [acceptList, setAcceptList] = useState<(string | number)[]>([])\n\n const toggleItemCheck = (id: string | number) => {\n setAcceptList((prev) => {\n if (prev.includes(id)) {\n return prev.filter((item) => item !== id)\n }\n return [...prev, id]\n })\n }\n\n /** 是否可以注册 */\n const isAccept = useMemo(() => {\n /** 所有必须勾选的都勾了就可以通过 */\n return agreements\n .filter((item) => item.required)\n .every((item) => acceptList.includes(item.id))\n }, [acceptList, agreements])\n\n useEffect(() => {\n onChange(isAccept)\n }, [isAccept, onChange])\n\n return (\n <div\n className={getClassnames([\n 'authing-agreements',\n showError && 'authing-agreements-error',\n ])}\n >\n {agreements.map((item) => {\n return (\n <div\n key={item.id}\n style={{ ...style }}\n className={getClassnames([\n 'authing-agreements-item',\n item.required &&\n !acceptList.includes(item.id) &&\n 'authing-agreements-item-invalid',\n ])}\n onClick={() => toggleItemCheck(item.id)}\n >\n <Space align=\"start\" size={5}>\n <Checkbox\n className=\"authing-agreements-checkbox\"\n checked={acceptList.includes(item.id)}\n />\n <div\n className=\"authing-agreements-item-content\"\n dangerouslySetInnerHTML={{\n __html: item.title,\n }}\n ></div>\n </Space>\n </div>\n )\n })}\n </div>\n )\n}\n","import React, { forwardRef, useImperativeHandle, useState } from 'react'\nimport { Input, Form, message } from 'antd'\nimport { FormInstance } from 'antd/lib/form'\nimport { UserOutlined, LockOutlined } from '@ant-design/icons'\n\nimport {\n getDeviceName,\n getRequiredRules,\n getUserRegisterParams,\n VALIDATE_PATTERN,\n} from '../../../../utils'\nimport { useGuardContext } from '../../../../context/global/context'\nimport {\n EmailRegisterFormProps,\n RegisterMethods,\n} from '../../../../components/AuthingGuard/types'\nimport { RegisterFormFooter } from '../../../../components/AuthingGuard/Forms/RegisterFormFooter'\nimport { useTranslation } from 'react-i18next'\nimport { Agreements } from '../Agreements'\n\nexport const EmailRegisterForm = forwardRef<\n FormInstance,\n EmailRegisterFormProps\n>(({ onSuccess, onFail, onValidateFail }, ref) => {\n const { t } = useTranslation()\n const {\n state: { authClient, config, guardEvents },\n } = useGuardContext()\n\n const { agreements, agreementEnabled } = config\n\n const [rawForm] = Form.useForm()\n\n const [loading, setLoading] = useState(false)\n\n const onFinishFailed = (errorInfo: any) => {\n setLoading(false)\n onValidateFail && onValidateFail(errorInfo)\n }\n\n const [acceptedAgreements, setAcceptedAgreements] = useState(false)\n\n /** 表单是否被提交校验过 */\n const [validated, setValidated] = useState(false)\n\n const onFinish = async (values: any) => {\n if (guardEvents.onBeforeRegister) {\n try {\n const canRegister = await guardEvents.onBeforeRegister(\n {\n type: RegisterMethods.Email,\n data: {\n email: values.email,\n password: values.password,\n },\n },\n authClient\n )\n\n if (!canRegister) {\n setLoading(false)\n return\n }\n } catch (e) {\n if (typeof e === 'string') {\n message.error(e)\n } else {\n message.error(e.message)\n }\n setLoading(false)\n return\n }\n }\n\n try {\n await rawForm.validateFields()\n\n setValidated(true)\n\n if (agreementEnabled && agreements?.length && !acceptedAgreements) {\n return\n }\n\n const { email, password } = values\n // 注册并获取登录态\n const user = await authClient.registerByEmail(\n email,\n password,\n {\n browser:\n typeof navigator !== 'undefined' ? navigator.userAgent : null,\n device: getDeviceName(),\n },\n {\n generateToken: true,\n params: getUserRegisterParams(),\n }\n )\n onSuccess && onSuccess(user)\n } catch (error) {\n onFail && onFail(error)\n } finally {\n setLoading(false)\n }\n }\n\n useImperativeHandle(ref, () => rawForm)\n\n const formItems = [\n {\n component: (\n <Input\n autoComplete=\"email\"\n size=\"large\"\n placeholder={t('login.inputEmail')}\n prefix={<UserOutlined style={{ color: '#ddd' }} />}\n />\n ),\n name: 'email',\n rules: getRequiredRules(t('common.emailNotNull')).concat({\n pattern: VALIDATE_PATTERN.email,\n message: t('login.emailError'),\n }),\n },\n {\n component: (\n <Input.Password\n size=\"large\"\n placeholder={t('common.setPassword')}\n prefix={<LockOutlined style={{ color: '#ddd' }} />}\n />\n ),\n name: 'password',\n rules: getRequiredRules(t('common.passwordNotNull')),\n },\n {\n component: (\n <Input.Password\n size=\"large\"\n placeholder={t('login.inputPwdAgain')}\n prefix={<LockOutlined style={{ color: '#ddd' }} />}\n />\n ),\n name: 'new-password',\n rules: getRequiredRules(t('common.repeatPassword')).concat({\n validator: (rule, value) => {\n if (value !== rawForm.getFieldValue('password')) {\n return Promise.reject(t('common.repeatPasswordDoc'))\n } else {\n return Promise.resolve()\n }\n },\n }),\n },\n ]\n\n return (\n <Form\n form={rawForm}\n onFinish={onFinish}\n onSubmitCapture={() => setLoading(true)}\n onFinishFailed={onFinishFailed}\n >\n {formItems.map((item) => (\n <Form.Item key={item.name} name={item.name} rules={item.rules}>\n {item.component}\n </Form.Item>\n ))}\n\n {config.agreementEnabled && Boolean(agreements?.length) && (\n <Agreements\n onChange={setAcceptedAgreements}\n agreements={agreements}\n showError={validated}\n />\n )}\n\n <RegisterFormFooter loading={loading} />\n </Form>\n )\n})\n","import { Input, Form, message } from 'antd'\nimport { FormInstance } from 'antd/lib/form'\nimport React, { forwardRef, useImperativeHandle, useState } from 'react'\nimport { UserOutlined, LockOutlined, SafetyOutlined } from '@ant-design/icons'\n\nimport { useGuardContext } from '../../../../context/global/context'\nimport {\n PhoneRegisterFormProps,\n RegisterMethods,\n} from '../../../../components/AuthingGuard/types'\nimport {\n getDeviceName,\n getRequiredRules,\n getUserRegisterParams,\n VALIDATE_PATTERN,\n} from '../../../../utils'\nimport { SendPhoneCode } from '../../../../components/AuthingGuard/Forms/SendPhoneCode'\nimport { RegisterFormFooter } from '../../../../components/AuthingGuard/Forms/RegisterFormFooter'\nimport { useTranslation } from 'react-i18next'\nimport { Agreements } from '../Agreements'\n\nexport const PhoneRegisterForm = forwardRef<\n FormInstance,\n PhoneRegisterFormProps\n>(({ onSuccess, onFail, onValidateFail }, ref) => {\n const {\n state: { authClient, config, guardEvents },\n } = useGuardContext()\n const { t } = useTranslation()\n\n const [rawForm] = Form.useForm()\n\n const { agreements, agreementEnabled } = config\n\n /** 表单是否被提交校验过 */\n const [validated, setValidated] = useState(false)\n\n const [phone, setPhone] = useState('')\n const [loading, setLoading] = useState(false)\n\n const onFinishFailed = (errorInfo: any) => {\n setLoading(false)\n onValidateFail && onValidateFail(errorInfo)\n }\n\n const [acceptedAgreements, setAcceptedAgreements] = useState(false)\n\n const onFinish = async (values: any) => {\n if (guardEvents.onBeforeRegister) {\n try {\n const canRegister = await guardEvents.onBeforeRegister(\n {\n type: RegisterMethods.Phone,\n data: {\n phone: values.phone,\n password: values.password,\n code: values.code,\n },\n },\n authClient\n )\n\n if (!canRegister) {\n setLoading(false)\n return\n }\n } catch (e) {\n if (typeof e === 'string') {\n message.error(e)\n } else {\n message.error(e.message)\n }\n setLoading(false)\n return\n }\n }\n\n try {\n await rawForm.validateFields()\n\n setValidated(true)\n\n if (agreementEnabled && agreements?.length && !acceptedAgreements) {\n return\n }\n\n const { phone, code, password } = values\n const user = await authClient.registerByPhoneCode(\n phone,\n code,\n password,\n {\n browser:\n typeof navigator !== 'undefined' ? navigator.userAgent : null,\n device: getDeviceName(),\n },\n {\n generateToken: true,\n params: getUserRegisterParams(),\n }\n )\n onSuccess && onSuccess(user)\n } catch (error) {\n onFail && onFail(error)\n } finally {\n setLoading(false)\n }\n }\n\n useImperativeHandle(ref, () => rawForm)\n\n const formItems = [\n {\n component: (\n <Input\n autoComplete=\"tel\"\n onChange={(e) => {\n setPhone(e.target.value)\n }}\n size=\"large\"\n placeholder={t('login.inputPhone')}\n prefix={<UserOutlined style={{ color: '#ddd' }} />}\n />\n ),\n name: 'phone',\n rules: getRequiredRules(t('common.phoneNotNull')).concat({\n pattern: VALIDATE_PATTERN.phone,\n message: t('login.phoneError'),\n }),\n },\n {\n component: (\n <Input.Password\n size=\"large\"\n placeholder={t('common.setPassword')}\n prefix={<LockOutlined style={{ color: '#ddd' }} />}\n />\n ),\n name: 'password',\n rules: getRequiredRules(t('common.passwordNotNull')),\n },\n {\n component: (\n <Input.Password\n size=\"large\"\n placeholder={t('login.inputPwdAgain')}\n prefix={<LockOutlined style={{ color: '#ddd' }} />}\n />\n ),\n name: 'new-password',\n rules: getRequiredRules(t('common.repeatPassword')).concat({\n validator: (rule, value) => {\n if (value !== rawForm.getFieldValue('password')) {\n return Promise.reject(t('common.repeatPasswordDoc'))\n } else {\n return Promise.resolve()\n }\n },\n }),\n },\n {\n component: (\n <Input\n autoComplete=\"one-time-code\"\n size=\"large\"\n placeholder={t('common.inputFourVerifyCode', {\n length: 4,\n })}\n prefix={<SafetyOutlined style={{ color: '#ddd' }} />}\n addonAfter={<SendPhoneCode phone={phone} />}\n />\n ),\n name: 'code',\n rules: getRequiredRules(t('common.captchaCodeNotNull')),\n },\n ]\n\n return (\n <Form\n form={rawForm}\n onSubmitCapture={() => setLoading(true)}\n onFinishFailed={onFinishFailed}\n onFinish={onFinish}\n >\n {formItems.map((item) => (\n <Form.Item name={item.name} key={item.name} rules={item.rules}>\n {item.component}\n </Form.Item>\n ))}\n\n {config.agreementEnabled && Boolean(agreements?.length) && (\n <Agreements\n onChange={setAcceptedAgreements}\n agreements={agreements}\n showError={validated}\n />\n )}\n\n <RegisterFormFooter loading={loading} />\n </Form>\n )\n})\n","import { Input, Form, Alert, message as Message, message } from 'antd'\nimport { FormInstance, Rule } from 'antd/lib/form'\nimport { UserOutlined, LockOutlined } from '@ant-design/icons'\nimport React, {\n forwardRef,\n useImperativeHandle,\n useMemo,\n useState,\n} from 'react'\n\nimport { getRequiredRules, getUserRegisterParams } from '../../../../utils'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { NEED_CAPTCHA } from '../../../../components/AuthingGuard/constants'\nimport {\n LoginMethods,\n PasswordLoginFormProps,\n User,\n} from '../../../../components/AuthingGuard/types'\nimport { LoginFormFooter } from '../../../../components/AuthingGuard/Forms/LoginFormFooter'\nimport { useTranslation } from 'react-i18next'\nimport { PasswordLoginMethods } from '../../api'\nimport { requestClient } from '../../api/http'\n\nexport const PasswordLoginForm = forwardRef<\n FormInstance,\n PasswordLoginFormProps\n>(({ onSuccess, onValidateFail, onFail }, ref) => {\n const { state, getValue } = useGuardContext()\n const { t } = useTranslation()\n\n const { config, authClient, realHost, userPoolId, appId, guardEvents } = state\n const autoRegister = config.autoRegister\n\n const captchaUrl = `${realHost}/api/v2/security/captcha`\n const getCaptchaUrl = () => `${captchaUrl}?r=${+new Date()}`\n\n const [rawForm] = Form.useForm()\n\n const [needCaptcha, setNeedCaptcha] = useState(false)\n const [verifyCodeUrl, setVerifyCodeUrl] = useState<string | null>(null)\n const [loading, setLoading] = useState(false)\n\n const onFinishFailed = (errorInfo: any) => {\n setLoading(false)\n onValidateFail && onValidateFail(errorInfo)\n }\n\n const loginMethodsText = useMemo<\n Record<\n PasswordLoginMethods,\n {\n t: string\n sort: number\n }\n >\n >(\n () => ({\n 'email-password': {\n t: t('common.email'),\n sort: 2,\n },\n 'phone-password': {\n t: t('common.phoneNumber'),\n sort: 1,\n },\n 'username-password': {\n t: t('common.username'),\n sort: 0,\n },\n }),\n [t]\n )\n\n const usernamePlaceholder = useMemo(\n () =>\n t('login.inputAccount', {\n text: config.passwordLoginMethods\n ?.map((item) => loginMethodsText[item])\n .sort((a, b) => a.sort - b.sort)\n .map((item) => item.t)\n .join(' / '),\n }),\n [config.passwordLoginMethods, loginMethodsText, t]\n )\n\n const identityRules = useMemo(() => {\n const rules: Rule[] = getRequiredRules(t('common.accNotNull'))\n\n const loginMethods = config.passwordLoginMethods\n\n if (\n loginMethods?.includes('email-password') &&\n loginMethods?.length === 1\n ) {\n rules.push({\n type: 'email',\n message: t('common.emailFormatError'),\n })\n }\n\n return rules\n }, [config, t])\n\n const login = async (values: any) => {\n const identity = values.identity && values.identity.trim()\n const password = values.password && values.password.trim()\n const captchaCode = values.captchaCode && values.captchaCode.trim()\n\n const encrypt = authClient.options.encryptFunction\n\n const { publicKey, autoRegister } = getValue('config')\n const { code, data, message } = await requestClient.post<User>(\n '/api/v2/login/account',\n {\n account: identity,\n password: await encrypt!(password, publicKey),\n captchaCode,\n customData: getUserRegisterParams(),\n autoRegister: autoRegister,\n },\n {\n headers: {\n 'x-authing-userpool-id': userPoolId,\n 'x-authing-app-id': appId,\n },\n }\n )\n\n if (code === 200) {\n return data\n } else {\n Message.error(message)\n // eslint-disable-next-line no-throw-literal\n throw {\n code,\n message,\n data,\n }\n }\n }\n\n const onFinish = async (values: any) => {\n if (guardEvents.onBeforeLogin) {\n try {\n const canLogin = await guardEvents.onBeforeLogin(\n {\n type: LoginMethods.Password,\n data: {\n identity: values.identity,\n password: values.password,\n captchaCode: values.captchaCode,\n },\n },\n authClient\n )\n\n if (!canLogin) {\n setLoading(false)\n return\n }\n } catch (e) {\n if (typeof e === 'string') {\n message.error(e)\n } else {\n message.error(e.message)\n }\n setLoading(false)\n return\n }\n }\n\n try {\n let user: User | undefined\n user = await login(values)\n user && onSuccess && onSuccess(user)\n } catch (error) {\n if (error.code === NEED_CAPTCHA && verifyCodeUrl === null) {\n setNeedCaptcha(true)\n setVerifyCodeUrl(getCaptchaUrl())\n }\n\n onFail && onFail(error)\n } finally {\n setLoading(false)\n }\n }\n\n useImperativeHandle(ref, () => rawForm)\n\n const formItems = [\n {\n component: (\n <Input\n autoComplete=\"email,username,tel\"\n size=\"large\"\n placeholder={usernamePlaceholder}\n prefix={<UserOutlined style={{ color: '#ddd' }} />}\n />\n ),\n name: 'identity',\n rules: identityRules,\n },\n {\n component: (\n <Input.Password\n size=\"large\"\n placeholder={t('login.inputLoginPwd')}\n prefix={<LockOutlined style={{ color: '#ddd' }} />}\n />\n ),\n name: 'password',\n rules: getRequiredRules(t('common.passwordNotNull')),\n },\n {\n component: (\n <Input\n size=\"large\"\n placeholder={t('login.inputCaptchaCode')}\n addonAfter={\n <img\n src={verifyCodeUrl ?? ''}\n alt={t('login.captchaCode')}\n style={{ height: '2em', cursor: 'pointer' }}\n onClick={() => setVerifyCodeUrl(getCaptchaUrl())}\n />\n }\n />\n ),\n name: 'captchaCode',\n rules: getRequiredRules(t('common.captchaCodeNotNull')),\n hide: !needCaptcha,\n },\n ]\n\n return (\n <Form\n form={rawForm}\n onSubmitCapture={() => setLoading(true)}\n onFinishFailed={onFinishFailed}\n onFinish={onFinish}\n >\n {autoRegister && (\n <Alert message={t('login.autoRegister')} style={{ marginBottom: 24 }} />\n )}\n {formItems.map(\n (item) =>\n !item.hide && (\n <Form.Item key={item.name} name={item.name} rules={item.rules}>\n {item.component}\n </Form.Item>\n )\n )}\n\n <LoginFormFooter\n needRegister\n needRestPwd\n loading={loading}\n ></LoginFormFooter>\n </Form>\n )\n})\n","/** eslint-disable */\n/**\n * !!!!!!!!!!!! 注意注意!!!!!!!!!!!!!\n *\n * 只要替换 svgStr 中的字符串即可,为了兼容 SSR!!!!!!\n *\n */\nimport { svgStr } from './svg'\nvar init = function (a) {\n var c,\n t,\n l,\n e,\n i,\n o,\n h = svgStr,\n m = (m = document.getElementsByTagName('script'))[\n m.length - 1\n ].getAttribute('data-injectcss')\n if (m && !a.__iconfont__svg__cssinject__) {\n a.__iconfont__svg__cssinject__ = !0\n try {\n document.write(\n '<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>'\n )\n } catch (a) {\n console && console.log(a)\n }\n }\n function n() {\n i || ((i = !0), l())\n }\n ;(c = function () {\n var a, c, t\n ;((t = document.createElement('div')).innerHTML = h),\n (h = null),\n (c = t.getElementsByTagName('svg')[0]) &&\n (c.setAttribute('aria-hidden', 'true'),\n (c.style.position = 'absolute'),\n (c.style.width = 0),\n (c.style.height = 0),\n (c.style.overflow = 'hidden'),\n (a = c),\n (t = document.body).firstChild\n ? (c = t.firstChild).parentNode.insertBefore(a, c)\n : t.appendChild(a))\n }),\n document.addEventListener\n ? ~['complete', 'loaded', 'interactive'].indexOf(document.readyState)\n ? setTimeout(c, 0)\n : ((t = function () {\n document.removeEventListener('DOMContentLoaded', t, !1), c()\n }),\n document.addEventListener('DOMContentLoaded', t, !1))\n : document.attachEvent &&\n ((l = c),\n (e = a.document),\n (i = !1),\n (o = function () {\n try {\n e.documentElement.doScroll('left')\n } catch (a) {\n return void setTimeout(o, 50)\n }\n n()\n })(),\n (e.onreadystatechange = function () {\n 'complete' == e.readyState && ((e.onreadystatechange = null), n())\n }))\n}\n\nif (typeof window !== 'undefined' && typeof window.document !== 'undefined') {\n init(window)\n}\n","export const svgStr =\n '<svg><symbol id=\"authing-gitlab\" viewBox=\"0 0 1024 1024\"><path d=\"M958.326 570.912l-50.136-154.3L808.827 110.8c-5.111-15.733-27.372-15.733-32.485 0l-99.365 305.812H347.024L247.656 110.8c-5.11-15.733-27.37-15.733-32.484 0l-99.363 305.812-50.134 154.3c-4.575 14.073 0.437 29.49 12.407 38.19L512 924.358 945.92 609.1a34.16 34.16 0 0 0 12.407-38.19\" ></path></symbol><symbol id=\"authing-yuyan\" viewBox=\"0 0 1024 1024\"><path d=\"M960 511.616A447.808 447.808 0 0 0 512 64C264.576 64 64 264.384 64 511.616a447.808 447.808 0 0 0 392.32 444.16 224.384 224.384 0 0 0 60.352 3.456A447.744 447.744 0 0 0 960 511.616z m-64 6.4a437.952 437.952 0 0 0-8.768-65.472c0.384-7.616 0.512-14.784 0.256-21.504 5.696 26.496 8.512 53.504 8.512 80.64v6.272z m-768-6.4c0-26.56 2.752-53.12 8.192-79.104 16.576 17.728 55.68 17.28 65.216-9.216 17.024 10.176 39.936 12.032 39.936 32.32 0 67.072 2.432 138.944 63.36 140.032 1.664 0 33.92 12.224 49.28 52.096 5.312 13.76 26.304 0 49.344 0 11.52 0 0 19.328 0 61.184 0 41.92 89.92 105.984 89.92 105.984-0.384 27.584 0.768 49.92 3.008 67.712a150.912 150.912 0 0 0-50.816 6.848A383.68 383.68 0 0 1 128 511.616z m478.592 371.968c-2.048-9.728-10.752-15.04-26.624-10.88 12.672-54.016 18.816-84.288 45.312-107.2 38.272-33.216 4.48-70.144-24.576-65.792-23.04 3.456-8.448-28.416-29.056-30.208-20.544-1.728-47.232-42.432-76.736-56.512-15.616-7.424-30.976-27.328-55.104-28.16-21.376-0.832-52.672 18.048-52.672 3.456 0-46.912-4.8-80.448-5.76-93.76-0.768-10.752-7.04-3.648 21.888-2.944 15.744 0.384 8.064-31.616 23.616-32.832 15.296-1.28 51.712 14.272 60.992 8.128 8.64-5.76 63.36 143.744 63.36 24.704 0-14.08-7.296-38.72 0-52.096 28.992-52.864 56.064-95.936 53.632-102.208-1.344-3.584-29.568-6.464-52.16 1.088-7.68 2.56 2.432 14.464-8.512 17.024-41.024 9.472-77.248-11.072-64.64-30.336 13.056-19.84 60.16-8.64 64.256-48.256 2.368-22.72 4.352-49.088 5.632-68.608 55.232 8.64 49.152-71.616-32.896-80.192a384.128 384.128 0 0 1 358.272 257.92 15.552 15.552 0 0 0-9.152-4.16c-24.832-62.016-84.992-17.152-64.64 37.504-109.44 84.16-81.408 142.784-45.44 176.384 18.944 17.728 36.992 44.288 48.704 63.36-12.8 37.248 47.104 22.336 76.672-40.96a384.576 384.576 0 0 1-274.432 265.6z\" ></path></symbol><symbol id=\"authing-anzhuo\" viewBox=\"0 0 1024 1024\"><path d=\"M141.1 331.2c-35 0-63.3 28.3-63.3 63.2v264.7c0 34.9 28.4 63.2 63.3 63.2 35 0 63.3-28.3 63.3-63.2V394.4c0-34.9-28.3-63.2-63.3-63.2zM228.9 753.3c0 37.3 30.3 67.5 67.6 67.5h46.1v140c0 34.9 28.4 63.2 63.3 63.2 35 0 63.3-28.3 63.3-63.2v-140h85.5v140c0 34.9 28.4 63.2 63.3 63.2 35 0 63.3-28.3 63.3-63.2v-140h46.1c37.3 0 67.6-30.2 67.6-67.5V343.1H228.9v410.2zM651.8 93.4L696 13c2.4-4.2 0.8-9.6-3.5-11.9-4.2-2.3-9.6-0.8-11.9 3.5l-44.7 81.2C598.4 69.2 556.4 59.9 512 59.9c-44.4 0-86.4 9.3-123.9 25.8L343.4 4.6c-2.3-4.3-7.7-5.8-11.9-3.5-4.3 2.3-5.9 7.7-3.5 11.9l44.2 80.4c-86.8 44.8-145.5 130-145.5 227.7h570.5c0.1-97.8-58.6-182.9-145.4-227.7zM382.2 218c-13.2 0-23.9-10.7-23.9-23.9s10.7-23.9 23.9-23.9 23.9 10.7 23.9 23.9c-0.1 13.2-10.8 23.9-23.9 23.9z m259.7 0c-13.2 0-23.9-10.7-23.9-23.9s10.7-23.9 23.9-23.9 23.9 10.7 23.9 23.9c-0.1 13.2-10.8 23.9-23.9 23.9zM882.9 331.2c-35 0-63.3 28.3-63.3 63.2v264.7c0 34.9 28.4 63.2 63.3 63.2 35 0 63.3-28.3 63.3-63.2V394.4c0-34.9-28.3-63.2-63.3-63.2z\" ></path></symbol><symbol id=\"authing-lark-public\" viewBox=\"0 0 1024 1024\"><path d=\"M933.875 98.5625L726.53414917 322.64486695a6.61651612 6.61651612 0 0 0-1.64300537 5.81726073 40.54449463 40.54449463 0 0 1-68.92053223 36.37023927L490.72827148 530.02856445l16.29821778 218.30960083L692.5625 933.875z m0 0\" ></path><path d=\"M931.6098938 104.2026062l-205.12023926 221.68377685a6.61651612 6.61651612 0 0 0-1.64300537 5.86175538 39.96688843 39.96688843 0 0 1-68.21026612 35.92611694L494.23675537 530.07388305a3.28601074 3.28601074 0 0 0-0.93273925 2.53125l16.03125 214.40148927 413.61547851-623.97537232 8.88162232-18.74047852z m0 0\" ></path><path d=\"M925.48199463 90.16949463L701.39880372 297.46502685a6.61651612 6.61651612 0 0 1-5.86175538 1.68832398 40.54449463 40.54449463 0 0 0-36.32574462 68.92053222L493.97143555 533.31622315l-218.22143555-16.43005372L90.125 331.43667602z m0 0\" ></path><path d=\"M919.8427124 92.65625l-221.77359008 205.12023926a6.61651612 6.61651612 0 0 1-5.77276612 1.64300537 39.96688843 39.96688843 0 0 0-35.92611695 68.21026612L493.92611695 530.02938843a3.28601074 3.28601074 0 0 1-2.57574463 0.93273925l-214.40148927-16.03125L900.96875 101.31539917l18.74047852-8.88079834z m0 0\" ></path></symbol><symbol id=\"authing-lark-internal\" viewBox=\"0 0 1024 1024\"><path d=\"M933.875 98.5625L726.53414917 322.64486695a6.61651612 6.61651612 0 0 0-1.64300537 5.81726073 40.54449463 40.54449463 0 0 1-68.92053223 36.37023927L490.72827148 530.02856445l16.29821778 218.30960083L692.5625 933.875z m0 0\" ></path><path d=\"M931.6098938 104.2026062l-205.12023926 221.68377685a6.61651612 6.61651612 0 0 0-1.64300537 5.86175538 39.96688843 39.96688843 0 0 1-68.21026612 35.92611694L494.23675537 530.07388305a3.28601074 3.28601074 0 0 0-0.93273925 2.53125l16.03125 214.40148927 413.61547851-623.97537232 8.88162232-18.74047852z m0 0\" ></path><path d=\"M925.48199463 90.16949463L701.39880372 297.46502685a6.61651612 6.61651612 0 0 1-5.86175538 1.68832398 40.54449463 40.54449463 0 0 0-36.32574462 68.92053222L493.97143555 533.31622315l-218.22143555-16.43005372L90.125 331.43667602z m0 0\" ></path><path d=\"M919.8427124 92.65625l-221.77359008 205.12023926a6.61651612 6.61651612 0 0 1-5.77276612 1.64300537 39.96688843 39.96688843 0 0 0-35.92611695 68.21026612L493.92611695 530.02938843a3.28601074 3.28601074 0 0 1-2.57574463 0.93273925l-214.40148927-16.03125L900.96875 101.31539917l18.74047852-8.88079834z m0 0\" ></path></symbol><symbol id=\"authing-guanbi7-01copy_1\" viewBox=\"0 0 1024 1024\"><path d=\"M0.00007 512.306485a511.999485 511.999485 0 0 1 1023.99797-0.512v0.512a510.974486 510.974486 0 0 1-511.999485 511.691485C228.86384 1023.99797 0.00007 794.725201 0.00007 512.306485z m546.200451 0l178.89282-178.78982a23.244977 23.244977 0 0 0 0-33.075967l-1.126999-1.023999a23.244977 23.244977 0 0 0-33.176967 0L511.999555 478.514519l-178.78982-179.19982a23.244977 23.244977 0 0 0-33.177967 0l-1.023999 1.023999a23.244977 23.244977 0 0 0 0 33.074967l178.78982 179.199819-178.89282 178.789821a23.244977 23.244977 0 0 0 0 33.177966l1.126999 1.023999a23.244977 23.244977 0 0 0 33.176967 0L511.999555 547.12245 690.789375 725.80927a23.244977 23.244977 0 0 0 33.177967 0l1.023999-1.023999a23.244977 23.244977 0 0 0 0-33.176967l-178.78982-179.199819z\" ></path></symbol><symbol id=\"authing-guanbi\" viewBox=\"0 0 1024 1024\"><path d=\"M583.168 523.776L958.464 148.48c18.944-18.944 18.944-50.176 0-69.12l-2.048-2.048c-18.944-18.944-50.176-18.944-69.12 0L512 453.12 136.704 77.312c-18.944-18.944-50.176-18.944-69.12 0l-2.048 2.048c-19.456 18.944-19.456 50.176 0 69.12l375.296 375.296L65.536 899.072c-18.944 18.944-18.944 50.176 0 69.12l2.048 2.048c18.944 18.944 50.176 18.944 69.12 0L512 594.944 887.296 970.24c18.944 18.944 50.176 18.944 69.12 0l2.048-2.048c18.944-18.944 18.944-50.176 0-69.12L583.168 523.776z\" ></path></symbol><symbol id=\"authing-apple-web\" viewBox=\"0 0 1024 1024\"><path d=\"M797.3 656c24.6 34.8 52.8 57.3 84.6 67.5-13.8 42.6-35.7 87-65.7 133.2-46.2 69.6-91.8 104.4-136.8 104.4-16.8 0-41.7-5.7-74.7-17.1-30.6-11.4-57.3-17.1-80.1-17.1-22.8 0-48 6-75.6 18-28.8 11.4-52.5 17.1-71.1 17.1-54 0-107.1-45.9-159.3-137.7-52.2-90.6-78.3-179.7-78.3-267.3 0-81 19.8-147.3 59.4-198.9 40.8-51.6 91.2-77.4 151.2-77.4 13.2 0 27.9 1.65 44.1 4.95 16.2 3.3 33 9.45 50.4 18.45 18.6 10.2 33.9 17.25 45.9 21.15 12 3.9 21.3 5.85 27.9 5.85 7.8 0 19.8-1.8 36-5.4a166.088 166.088 0 0 0 48.6-19.8 366.113 366.113 0 0 1 45-21.6c12.6-4.8 25.5-7.2 38.7-7.2 42 0 79.8 11.4 113.4 34.2 18 12 36.3 29.7 54.9 53.1-27.6 24-47.7 45-60.3 63-23.4 33.6-35.1 70.2-35.1 109.8 0 43.8 12.3 83.4 36.9 118.8zM616.4 235.7c-21 19.8-40.2 32.7-57.6 38.7-6 1.8-13.65 3.45-22.95 4.95-9.3 1.5-19.95 2.85-31.95 4.05 0.6-52.8 14.4-98.4 41.4-136.8 27-38.4 71.4-64.8 133.2-79.2 1.2 6 2.1 10.2 2.7 12.6v9.9c0 21.6-5.1 45.9-15.3 72.9a221.625 221.625 0 0 1-49.5 72.9z\" ></path></symbol><symbol id=\"authing-google\" viewBox=\"0 0 1024 1024\"><path d=\"M1000 523.6c0 283-193.8 484.4-480 484.4-274.4 0-496-221.6-496-496S245.6 16 520 16c133.6 0 246 49 332.6 129.8l-135 129.8c-176.6-170.4-505-42.4-505 236.4 0 173 138.2 313.2 307.4 313.2 196.4 0 270-140.8 281.6-213.8H520V440.8h472.2c4.6 25.4 7.8 49.8 7.8 82.8z\" ></path></symbol><symbol id=\"authing-dingtalk\" viewBox=\"0 0 1024 1024\"><path d=\"M905.857912 382.800144a192.415957 192.415957 0 0 1-12.101998 31.649993h0.186l-0.744 1.257c-35.140992 76.657983-126.881972 226.998949-126.881971 226.998949s-0.093-0.373-0.466-0.93l-26.856994 47.567989h129.301971L621.375975 1024l56.039988-227.649949H575.715986l35.326992-150.525966a1436.834677 1436.834677 0 0 0-102.397977 29.789993s-54.130988 32.393993-155.923965-62.137986c0 0-68.699985-61.672986-28.857994-77.079982 16.941996-6.560999 82.197982-14.892997 133.53597-21.967996 69.444984-9.494998 112.172975-14.614997 112.172975-14.614996s-214.106952 3.257999-264.83994-4.886999c-50.732989-8.099998-115.104974-94.484979-128.834972-170.353962 0 0-21.223995-41.702991 45.65999-21.968995 66.838985 19.734996 343.499923 76.799983 343.499923 76.799983S205.267069 266.95017 181.250074 239.487176c-23.922995-27.459994-70.374984-149.732966-64.324985-224.901949 0 0 2.606999-18.757996 21.457995-13.729997 0 0 266.00294 123.946972 447.852899 191.762957 181.896959 67.815985 340.009924 102.398977 319.622929 190.181957z\" ></path></symbol><symbol id=\"authing-apple\" viewBox=\"0 0 1024 1024\"><path d=\"M797.3 656c24.6 34.8 52.8 57.3 84.6 67.5-13.8 42.6-35.7 87-65.7 133.2-46.2 69.6-91.8 104.4-136.8 104.4-16.8 0-41.7-5.7-74.7-17.1-30.6-11.4-57.3-17.1-80.1-17.1-22.8 0-48 6-75.6 18-28.8 11.4-52.5 17.1-71.1 17.1-54 0-107.1-45.9-159.3-137.7-52.2-90.6-78.3-179.7-78.3-267.3 0-81 19.8-147.3 59.4-198.9 40.8-51.6 91.2-77.4 151.2-77.4 13.2 0 27.9 1.65 44.1 4.95 16.2 3.3 33 9.45 50.4 18.45 18.6 10.2 33.9 17.25 45.9 21.15 12 3.9 21.3 5.85 27.9 5.85 7.8 0 19.8-1.8 36-5.4a166.088 166.088 0 0 0 48.6-19.8 366.113 366.113 0 0 1 45-21.6c12.6-4.8 25.5-7.2 38.7-7.2 42 0 79.8 11.4 113.4 34.2 18 12 36.3 29.7 54.9 53.1-27.6 24-47.7 45-60.3 63-23.4 33.6-35.1 70.2-35.1 109.8 0 43.8 12.3 83.4 36.9 118.8zM616.4 235.7c-21 19.8-40.2 32.7-57.6 38.7-6 1.8-13.65 3.45-22.95 4.95-9.3 1.5-19.95 2.85-31.95 4.05 0.6-52.8 14.4-98.4 41.4-136.8 27-38.4 71.4-64.8 133.2-79.2 1.2 6 2.1 10.2 2.7 12.6v9.9c0 21.6-5.1 45.9-15.3 72.9a221.625 221.625 0 0 1-49.5 72.9z\" ></path></symbol><symbol id=\"authing-alipay-web\" viewBox=\"0 0 1024 1024\"><path d=\"M427.154 210.262l-1.819 59.431H185.792v45.481h242.573v78.84H228.24v43.057l203.153-1.823 203.76-1.818-3.641 14.553c-9.094 35.177-47.907 129.173-55.183 132.196-4.244 1.216-33.961-5.458-67.316-15.16-101.276-30.924-151.61-40.023-220.136-40.023-69.74 0.603-115.217 13.342-158.886 44.27-84.897 60.647-91.57 179.506-12.735 245.602 83.687 70.348 220.739 77.017 345.06 16.375 44.267-21.225 123.71-78.84 150.39-108.553l10.922-12.736 34.57 16.98c34.568 17.586 248.03 116.437 284.413 131.598l19.403 8.49V711.17l-52.762-13.95c-47.907-12.74-170.406-50.94-209.826-66.105l-15.16-6.066 20.012-41.238c21.231-42.444 63.68-162.522 63.68-180.108 0-8.491-12.128-9.702-106.128-9.702H555.71v-78.827h254.704v-40.022c0-1.817-57.614-3.032-127.353-2.425l-127.347 0.602V151.437H428.967l-1.813 58.825z m-23.657 395.392c31.535 10.922 73.382 27.896 92.786 38.206l35.167 18.805-19.404 24.255c-10.913 13.342-35.775 36.387-56.399 51.548-69.133 51.542-133.41 71.553-215.887 66.703-86.112-4.852-132.201-40.023-137.66-105.517-3.64-40.63 5.459-63.675 33.359-84.901 35.172-26.685 63.67-32.742 141.296-30.924 59.431 1.814 78.232 5.449 126.742 21.825z\" ></path></symbol><symbol id=\"authing-wechat-miniprogram-app-launch\" viewBox=\"0 0 1126 1024\"><path d=\"M961.876 262.606C900.851 134.702 747.238 80.676 619.77 141.425c-69.45 33.34-113.232 90.332-130.04 168.839-15.583 71.308-6.328 150.685 2.926 211.869 12.22 78.071 12.656 135.459 1.7 176.393-9.69 36.306-29.464 59.957-61.46 75.54a135.814 135.814 0 0 1-104.372 5.102 137.634 137.634 0 0 1-77.835-69.647 136.764 136.764 0 0 1 64.388-181.93c14.317-7.12 25.668-19.38 30.73-34.607 5.023-15.187 4.628-31.244-2.136-45.996a60.511 60.511 0 0 0-34.487-30.81 61.54 61.54 0 0 0-45.878 2.136 256.284 256.284 0 0 0-131.86 145.98 257.233 257.233 0 0 0 10.284 196.72 256.403 256.403 0 0 0 231.802 146.494 263.007 263.007 0 0 0 110.265-24.916c69.41-33.341 113.192-89.462 130.04-167.97 15.149-70.913 6.328-150.29-2.966-210.603-12.22-78.942-12.656-136.764-1.701-177.698 9.69-36.307 29.465-60.354 62.292-75.54a136.962 136.962 0 0 1 182.205 64.585 136.764 136.764 0 0 1-64.387 181.93 60.511 60.511 0 0 0-28.16 80.167c6.724 14.753 19.34 25.708 34.053 30.81 15.148 5.063 31.166 4.628 45.877-2.135 127.51-62.45 181.378-216.101 120.786-343.531z\" ></path></symbol><symbol id=\"authing-qq\" viewBox=\"0 0 1024 1024\"><path d=\"M821.295 699.385a275.463 275.463 0 0 1-57.3 90.76c54.54 16.634 41.202 45.496 41.202 45.496 24.223 13.299 22.69 99.729-111.381 98.195-89.38-0.996-127.248-26.062-142.695-42.735-11.498 1.15-23.035 1.802-34.61 1.84-14.296 0-28.286-1.073-42.084-2.645-14.91 16.634-52.586 42.544-143.308 43.54-133.879 1.534-135.412-84.895-111.15-98.195 0 0-14.642-31.046 47.142-47.335a272.511 272.511 0 0 1-58.794-98.311c-56.035 99.537-83.057 33.575-79.033-42.66 3.604-67.687 63.241-144.61 78.726-163.43a60.98 60.98 0 0 1-4.6-22.804c0-16.482 6.593-31.506 17.363-42.775a44.844 44.844 0 0 1 20.045-46.223c-0.076-2.414-0.306-4.753-0.306-7.206 0-151.394 123.569-274.235 275.96-274.235 152.469 0 275.961 122.802 275.961 274.235 0 4.6-0.268 9.122-0.498 13.645 10.425 10.617 14.947 25.68 11.998 40.283 10.616 11.192 17.36 25.871 17.36 42.276 0 8.125-1.723 15.829-4.598 22.997 15.56 19.163 74.816 96.01 78.38 163.698 3.91 74.164-21.31 138.67-73.78 51.589z\" ></path></symbol><symbol id=\"authing-wechat-mobile\" viewBox=\"0 0 1239 1024\"><path d=\"M745.256 511.245c-21.665 0-43.385 20.373-43.385 45.595 0 20.373 21.72 40.96 43.385 40.96 32.553 0 55.835-20.587 55.835-40.96 0-25.222-23.282-45.595-55.835-45.595M602.705 298.9c34.115 0 55.78-22.097 55.78-55.08 0-34.655-21.665-55.027-55.78-55.027-32.499 0-63.488 20.372-63.488 54.973 0 33.091 30.99 55.08 63.488 55.08M440.05 756.574c-57.344 0-99.167-9.431-153.439-25.169l-156.456 80.196 44.948-135.222C65.051 597.747 0 498.58 0 377.479 0 163.57 198.333 0 440.05 0c213.8 0 404.427 128.97 441.56 311.458a211.106 211.106 0 0 0-41.822-4.743c-210.729 0-373.383 160.498-373.383 353.927 0 33.037 4.635 62.895 12.396 94.37-12.396 1.616-26.409 1.616-38.804 1.616m646.198 154.14L1117.13 1024l-117.76-67.638c-44.894 9.378-88.28 23.606-133.228 23.606-207.656 0-371.873-144.761-371.873-324.07 0-179.253 164.217-323.96 371.873-323.96 196.77 0 373.437 144.707 373.437 323.907 0 100.783-66.614 190.356-153.384 254.922M295.882 188.793c-32.498 0-66.614 20.372-66.614 54.973 0 33.091 34.116 55.08 66.614 55.08 30.99 0 55.781-21.989 55.781-55.026 0-34.655-24.791-55.027-55.78-55.027m692.6 322.452c-23.228 0-43.385 20.373-43.385 45.595 0 20.373 20.157 40.96 43.385 40.96 30.99 0 54.272-20.587 54.272-40.96 0-25.222-23.282-45.595-54.272-45.595\" ></path></symbol><symbol id=\"authing-baidu\" viewBox=\"0 0 1024 1024\"><path d=\"M204.8 537.876c104.422-22.429 90.196-147.185 86.967-174.501-5.149-42.066-54.545-115.55-121.658-109.746-84.48 7.593-96.873 129.6-96.873 129.6C61.891 439.695 100.64 560.262 204.8 537.876zM315.636 754.75c-3.141 8.858-9.861 31.244-4.058 50.75 11.607 43.766 49.658 45.774 49.658 45.774h54.677V717.658H357.44c-26.27 7.855-39.01 28.407-41.847 37.091z m82.779-426.022c57.774 0 104.29-66.37 104.29-148.407C502.705 98.327 456.19 32 398.415 32c-57.47 0-104.16 66.37-104.16 148.32 0 82.036 46.69 148.364 104.29 148.364z m248.334 9.731c77.062 10.037 126.676-72.262 136.407-134.618 10.037-62.138-39.665-134.53-94.21-146.924-54.633-12.523-122.88 75.055-129.077 132.131-7.418 69.818 9.95 139.462 86.88 149.411zM835.564 704.83s-119.259-92.247-188.815-191.913c-94.254-147.01-228.349-87.185-273.164-12.48-44.64 74.75-114.196 122.095-124.014 134.531-10.036 12.393-144 84.655-114.327 216.742 29.76 132 134.269 129.6 134.269 129.6s76.974 7.55 166.342-12.393c89.323-19.898 166.21 4.975 166.21 4.975s208.67 69.818 265.746-64.713C924.8 774.56 835.564 704.83 835.564 704.83zM478.487 905.076H342.865c-58.56-11.738-81.905-51.665-84.916-58.472-2.924-6.982-19.505-39.142-10.69-93.819 25.308-81.905 97.483-87.796 97.483-87.796h72.218v-88.844l61.484 0.96 0.087 327.928z m252.742-0.96H575.011c-60.524-15.534-63.316-58.56-63.316-58.56V672.844l63.36-1.004v155.127c3.84 16.495 24.436 19.637 24.436 19.637h64.32v-173.76h67.418v231.272z m220.975-461.018c0-29.847-24.742-119.65-116.64-119.65-92.073 0-104.335 84.741-104.335 144.654 0 57.163 4.887 137.062 119.127 134.443 114.415-2.443 101.848-129.469 101.848-159.447z\" ></path></symbol><symbol id=\"authing-wechat-pc\" viewBox=\"0 0 1239 1024\"><path d=\"M727.677 511.336c-19.042 0-38.132 17.906-38.132 40.074 0 17.906 19.09 36 38.132 36 28.61 0 49.074-18.094 49.074-36 0-22.168-20.463-40.074-49.074-40.074m-125.29-186.63c29.985 0 49.026-19.422 49.026-48.411 0-30.459-19.041-48.364-49.025-48.364-28.564 0-55.8 17.905-55.8 48.316 0 29.084 27.237 48.41 55.8 48.41m-142.959 402.3c-50.4 0-87.158-8.288-134.858-22.12L187.06 775.32l39.505-118.847c-96.726-69.11-153.9-156.269-153.9-262.705C72.667 205.763 246.984 62 459.43 62c187.91 0 355.454 113.353 388.09 273.742a185.542 185.542 0 0 0-36.757-4.168c-185.211 0-328.17 141.062-328.17 311.068 0 29.037 4.075 55.28 10.896 82.943-10.895 1.42-23.211 1.42-34.105 1.42M1027.33 862.48l27.19 99.52-103.5-59.447c-39.458 8.242-77.59 20.747-117.096 20.747-182.51 0-326.841-127.231-326.841-284.827 0-157.547 144.331-284.73 326.841-284.73 172.943 0 328.216 127.183 328.216 284.683 0 88.58-58.547 167.305-134.81 224.053M332.72 227.93c-28.563 0-58.548 17.905-58.548 48.316 0 29.084 29.985 48.41 58.547 48.41 27.238 0 49.026-19.326 49.026-48.362 0-30.459-21.788-48.364-49.025-48.364m608.73 283.405c-20.415 0-38.13 17.906-38.13 40.074 0 17.906 17.715 36 38.13 36 27.238 0 47.7-18.094 47.7-36 0-22.168-20.462-40.074-47.7-40.074\" ></path></symbol><symbol id=\"authing-wechat-miniprogram-qrconnec\" viewBox=\"0 0 1126 1024\"><path d=\"M961.876 262.606C900.851 134.702 747.238 80.676 619.77 141.425c-69.45 33.34-113.232 90.332-130.04 168.839-15.583 71.308-6.328 150.685 2.926 211.869 12.22 78.071 12.656 135.459 1.7 176.393-9.69 36.306-29.464 59.957-61.46 75.54a135.814 135.814 0 0 1-104.372 5.102 137.634 137.634 0 0 1-77.835-69.647 136.764 136.764 0 0 1 64.388-181.93c14.317-7.12 25.668-19.38 30.73-34.607 5.023-15.187 4.628-31.244-2.136-45.996a60.511 60.511 0 0 0-34.487-30.81 61.54 61.54 0 0 0-45.878 2.136 256.284 256.284 0 0 0-131.86 145.98 257.233 257.233 0 0 0 10.284 196.72 256.403 256.403 0 0 0 231.802 146.494 263.007 263.007 0 0 0 110.265-24.916c69.41-33.341 113.192-89.462 130.04-167.97 15.149-70.913 6.328-150.29-2.966-210.603-12.22-78.942-12.656-136.764-1.701-177.698 9.69-36.307 29.465-60.354 62.292-75.54a136.962 136.962 0 0 1 182.205 64.585 136.764 136.764 0 0 1-64.387 181.93 60.511 60.511 0 0 0-28.16 80.167c6.724 14.753 19.34 25.708 34.053 30.81 15.148 5.063 31.166 4.628 45.877-2.135 127.51-62.45 181.378-216.101 120.786-343.531z\" ></path></symbol><symbol id=\"authing-wechat-webpage-authorization\" viewBox=\"0 0 1188 1024\"><path d=\"M512 1.896C229.452 1.896 0 229.452 0 512s229.452 510.104 512 510.104S1022.104 794.548 1022.104 512 794.548 1.896 512 1.896z m-91.022 629.57c-26.548 0-49.304-5.688-75.852-11.377l-75.852 37.926 22.756-66.37c-54.993-37.926-87.23-87.23-87.23-147.912 0-104.296 98.607-185.837 218.074-185.837 108.089 0 201.007 64.474 219.97 153.6-7.585 0-13.274-1.896-20.859-1.896-104.296 0-185.837 77.748-185.837 172.563 0 15.17 1.896 30.34 7.585 45.511-7.585 3.793-15.17 3.793-22.755 3.793z m322.37 77.749l17.067 54.992-58.785-34.133c-22.756 5.689-43.615 11.378-66.37 11.378-104.297 0-185.838-70.163-185.838-157.393S530.963 424.77 635.26 424.77c98.608 0 185.837 70.163 185.837 159.29 0 47.407-32.237 91.021-77.748 125.155z\" fill=\"#46BB36\" ></path><path d=\"M318.578 379.26c0 17.066 13.274 30.34 30.34 30.34s30.341-13.274 30.341-30.34-13.274-30.341-30.34-30.341-30.341 13.274-30.341 30.34z m235.14 159.288c0 13.274 11.378 24.652 24.652 24.652 13.274 0 24.652-11.378 24.652-24.652 0-13.274-11.378-24.652-24.652-24.652-13.274-1.896-24.651 9.482-24.651 24.652z m-81.54-159.289c0 17.067 13.274 30.341 30.34 30.341 17.067 0 30.341-13.274 30.341-30.34 0-17.067-13.274-30.341-30.34-30.341-17.067 0-30.341 13.274-30.341 30.34zM675.08 538.55c0 13.273 11.378 24.651 24.652 24.651 13.274 0 24.652-11.378 24.652-24.652 0-13.274-11.378-24.652-24.652-24.652-13.274-1.896-24.652 9.482-24.652 24.652z\" fill=\"#46BB36\" ></path></symbol><symbol id=\"authing-wechat-miniprogram-default\" viewBox=\"0 0 1126 1024\"><path d=\"M961.876 262.606C900.851 134.702 747.238 80.676 619.77 141.425c-69.45 33.34-113.232 90.332-130.04 168.839-15.583 71.308-6.328 150.685 2.926 211.869 12.22 78.071 12.656 135.459 1.7 176.393-9.69 36.306-29.464 59.957-61.46 75.54a135.814 135.814 0 0 1-104.372 5.102 137.634 137.634 0 0 1-77.835-69.647 136.764 136.764 0 0 1 64.388-181.93c14.317-7.12 25.668-19.38 30.73-34.607 5.023-15.187 4.628-31.244-2.136-45.996a60.511 60.511 0 0 0-34.487-30.81 61.54 61.54 0 0 0-45.878 2.136 256.284 256.284 0 0 0-131.86 145.98 257.233 257.233 0 0 0 10.284 196.72 256.403 256.403 0 0 0 231.802 146.494 263.007 263.007 0 0 0 110.265-24.916c69.41-33.341 113.192-89.462 130.04-167.97 15.149-70.913 6.328-150.29-2.966-210.603-12.22-78.942-12.656-136.764-1.701-177.698 9.69-36.307 29.465-60.354 62.292-75.54a136.962 136.962 0 0 1 182.205 64.585 136.764 136.764 0 0 1-64.387 181.93 60.511 60.511 0 0 0-28.16 80.167c6.724 14.753 19.34 25.708 34.053 30.81 15.148 5.063 31.166 4.628 45.877-2.135 127.51-62.45 181.378-216.101 120.786-343.531z\" ></path></symbol><symbol id=\"authing-wechatwork-service-provider-authorization\" viewBox=\"0 0 1182 1024\"><path d=\"M993.598 913.02a7.062 7.062 0 0 1 4.908 2.224c15.678 17.761 37.252 31.073 59.816 35.505 15.713 3.354 26.482 18.873 26.482 36.634 0 19.968-14.706 36.617-32.362 36.617-16.666 0-30.402-14.424-32.361-32.185-4.909-25.53-15.714-47.722-30.42-65.466-0.971-1.112-1.942-3.337-2.931-5.561 0-4.432 2.93-7.768 6.868-7.768zM1024 0a105.931 105.931 0 0 1 105.931 105.949v453.42h-70.62V247.172H70.46v670.88h452.026v70.638H32.84C15.572 988.69 0.829 975.448 0 958.27v-857.9C2.79 44.19 49.346 0.053 105.843 0zM812.138 512c136.651 0 247.172 97.774 247.172 219.224h-60.804c0-101.888-85.663-162.286-182.22-163.045-117.565-0.918-189.686 76.182-193.553 157.184-2.471 51.412 16.42 92.495 61.617 127.47 5.032 4.131 4.184 17.479 3.178 23.658l-2.684 37.34s1.006 0 2.013-1.023l49.982-25.141a16.455 16.455 0 0 1 12.058-1.042c22.104 6.18 37.676 5.509 60.787 5.509 24.117 0 46.857-2.066 64.23-8.087l15.589 55.085a288.662 288.662 0 0 1-78.371 11.317c-25.124 0-49.24-3.09-72.334-9.27l-53.265 26.766c-5.014 2.065-12.059 3.09-18.08 3.09-6.037 0-12.058-2.066-17.09-5.138-10.045-7.221-15.06-19.562-14.053-34.993v-1.041l5.014-42.196c-49.222-40.148-76.358-97.775-76.358-157.484C564.966 609.792 675.486 512 812.138 512z m338.397 330.399c17.655 0 32.362 16.649 32.362 36.634 0 18.856-12.747 34.393-28.443 36.617-22.563 5.544-42.178 17.761-57.874 34.41a21.186 21.186 0 0 1-4.908 3.32c-3.92 0-6.868-3.32-6.868-7.769 0-2.225 0.99-4.431 1.978-5.544 15.678-17.76 27.454-42.178 31.373-67.707 2.948-17.744 16.684-29.961 32.38-29.961z m-141.242-30.261c3.92 0 6.868 3.337 6.868 7.768a9.075 9.075 0 0 1-1.977 5.544c-15.678 17.761-27.454 42.178-31.374 67.708-2.948 17.743-16.684 29.96-32.38 29.96-17.654 0-32.361-16.648-32.361-36.634 0-18.856 12.747-34.392 28.442-36.617 22.564-5.544 42.179-17.743 57.874-34.392 0.971-1.113 2.93-2.225 4.908-3.337z m39.23-70.62c16.667 0 30.402 14.424 32.362 32.185 4.908 25.511 15.713 47.722 30.42 65.465 1.942 1.112 1.942 3.337 2.93 5.561 0 4.432-2.93 7.769-6.867 7.769a7.062 7.062 0 0 1-4.908-2.225c-15.696-17.761-37.253-31.073-59.816-35.504-15.713-3.355-26.483-18.874-26.483-36.635 0-19.968 14.707-36.617 32.362-36.617zM511.912 70.584a53.177 53.177 0 0 0-37.5 15.537 53 53 0 0 0 17.426 86.422 53.407 53.407 0 0 0 58.05-11.582 52.824 52.824 0 0 0 11.388-57.838 53.23 53.23 0 0 0-49.364-32.539z m-176.605 0a53.177 53.177 0 0 0-37.5 15.537 53 53 0 0 0 17.426 86.422 53.407 53.407 0 0 0 58.05-11.582 52.824 52.824 0 0 0 11.388-57.838 53.23 53.23 0 0 0-49.364-32.539z m-176.499 0a53.177 53.177 0 0 0-37.5 15.537 53 53 0 0 0 17.426 86.422 53.407 53.407 0 0 0 58.05-11.582 52.824 52.824 0 0 0 11.388-57.838 53.23 53.23 0 0 0-49.364-32.539z\" ></path></symbol><symbol id=\"authing-wechatwork-corp-qrconnect\" viewBox=\"0 0 1220 1024\"><path d=\"M1077.17 663.237c-29.54-34.659-51.2-77.982-61.047-127.803-3.938-34.659-31.508-62.819-64.985-62.819-35.446 0-64.984 32.493-64.984 71.483 0 34.659 21.661 64.985 53.17 71.484 45.291 8.664 88.614 34.658 120.122 69.316 1.97 2.167 5.908 4.333 9.846 4.333 7.877 0 13.785-6.499 13.785-15.163-1.97-4.333-1.97-8.665-5.908-10.831z m-194.955-26.782c1.97-2.166 3.939-6.498 3.939-10.83 0-8.665-5.908-15.163-13.785-15.163-3.938 2.166-7.877 4.332-9.846 6.498-31.508 32.492-70.892 56.32-116.185 67.15-31.507 4.333-57.107 34.66-57.107 71.484 0 38.99 29.538 71.483 64.984 71.483 31.508 0 59.077-23.828 64.985-58.486 7.877-49.822 31.508-97.477 63.015-132.136z m165.416 243.2c31.507-32.492 70.892-56.32 116.184-67.15 31.508-4.333 57.108-34.659 57.108-71.483 0-38.991-29.538-71.484-64.985-71.484-31.507 0-59.076 23.828-64.984 58.487-7.877 49.821-31.508 97.477-63.016 132.135-1.969 2.166-3.938 6.498-3.938 10.83 0 8.665 5.908 15.164 13.785 15.164 3.938-2.166 7.877-4.332 9.846-6.499z m-76.8 1.379c-45.293-8.665-88.616-34.659-120.123-69.317a14.375 14.375 0 0 0-9.846-4.332c-7.877 0-13.785 6.498-13.785 15.163 1.97 4.332 3.938 8.664 5.908 10.83 29.538 34.659 51.2 77.982 61.046 127.804 3.938 34.658 31.507 62.818 64.984 62.818 35.447 0 64.985-32.492 64.985-71.483 0-34.659-21.662-64.985-53.17-71.483z\" ></path><path d=\"M243.554 810.2s2.048 0 4.096-2.067l101.534-50.708c8.172-4.135 16.345-4.135 24.497-2.067 44.899 12.445 76.544 11.106 123.49 11.106 48.995 0 95.174-4.155 130.502-16.325l31.665 111.065c-51.043 14.533-106.142 22.843-159.232 22.843a571.077 571.077 0 0 1-146.964-18.688l-108.19 53.957c-10.2 4.135-24.497 6.222-36.745 6.222-12.249 0-24.497-4.135-34.698-10.377-20.421-14.514-30.622-39.424-28.574-70.558v-2.068l10.201-85.07C55.099 676.51 0 560.285 0 439.926 0 197.12 224.551 0 502.154 0c277.622 0 502.154 197.14 502.154 442.014h-123.55c0-205.43-174.001-327.208-370.196-328.744-238.808-1.85-385.378 153.6-393.216 316.948-4.982 103.62 33.36 186.466 125.224 257.024 10.2 8.31 8.468 35.19 6.44 47.655\" ></path></symbol><symbol id=\"authing-wechatwork-service-provider-qrconnect\" viewBox=\"0 0 1220 1024\"><path d=\"M1077.17 663.237c-29.54-34.659-51.2-77.982-61.047-127.803-3.938-34.659-31.508-62.819-64.985-62.819-35.446 0-64.984 32.493-64.984 71.483 0 34.659 21.661 64.985 53.17 71.484 45.291 8.664 88.614 34.658 120.122 69.316 1.97 2.167 5.908 4.333 9.846 4.333 7.877 0 13.785-6.499 13.785-15.163-1.97-4.333-1.97-8.665-5.908-10.831z m-194.955-26.782c1.97-2.166 3.939-6.498 3.939-10.83 0-8.665-5.908-15.163-13.785-15.163-3.938 2.166-7.877 4.332-9.846 6.498-31.508 32.492-70.892 56.32-116.185 67.15-31.507 4.333-57.107 34.66-57.107 71.484 0 38.99 29.538 71.483 64.984 71.483 31.508 0 59.077-23.828 64.985-58.486 7.877-49.822 31.508-97.477 63.015-132.136z m165.416 243.2c31.507-32.492 70.892-56.32 116.184-67.15 31.508-4.333 57.108-34.659 57.108-71.483 0-38.991-29.538-71.484-64.985-71.484-31.507 0-59.076 23.828-64.984 58.487-7.877 49.821-31.508 97.477-63.016 132.135-1.969 2.166-3.938 6.498-3.938 10.83 0 8.665 5.908 15.164 13.785 15.164 3.938-2.166 7.877-4.332 9.846-6.499z m-76.8 1.379c-45.293-8.665-88.616-34.659-120.123-69.317a14.375 14.375 0 0 0-9.846-4.332c-7.877 0-13.785 6.498-13.785 15.163 1.97 4.332 3.938 8.664 5.908 10.83 29.538 34.659 51.2 77.982 61.046 127.804 3.938 34.658 31.507 62.818 64.984 62.818 35.447 0 64.985-32.492 64.985-71.483 0-34.659-21.662-64.985-53.17-71.483z\" ></path><path d=\"M243.554 810.2s2.048 0 4.096-2.067l101.534-50.708c8.172-4.135 16.345-4.135 24.497-2.067 44.899 12.445 76.544 11.106 123.49 11.106 48.995 0 95.174-4.155 130.502-16.325l31.665 111.065c-51.043 14.533-106.142 22.843-159.232 22.843a571.077 571.077 0 0 1-146.964-18.688l-108.19 53.957c-10.2 4.135-24.497 6.222-36.745 6.222-12.249 0-24.497-4.135-34.698-10.377-20.421-14.514-30.622-39.424-28.574-70.558v-2.068l10.201-85.07C55.099 676.51 0 560.285 0 439.926 0 197.12 224.551 0 502.154 0c277.622 0 502.154 197.14 502.154 442.014h-123.55c0-205.43-174.001-327.208-370.196-328.744-238.808-1.85-385.378 153.6-393.216 316.948-4.982 103.62 33.36 186.466 125.224 257.024 10.2 8.31 8.468 35.19 6.44 47.655\" ></path></symbol><symbol id=\"authing-weibo\" viewBox=\"0 0 1185 1024\"><path d=\"M891.75 466.973c-17.137-5.012-29.37-7.545-19.616-30.019 19.616-47.477 19.616-90 0-120.017-39.18-57.503-144.538-54.97-264.61-2.48 0 0-39.125 17.517-29.37-12.502 19.615-59.982 17.19-109.992-12.234-140.01-66.127-67.473-240.089 2.532-389.532 154.992C63.7 431.942 0 551.96 0 656.996c0 199.94 252.322 322.49 497.314 322.49 323.354 0 536.55-192.503 538.975-347.496 0-92.533-75.934-142.545-144.539-165.017zM499.794 907C303.79 926.941 134.73 836.94 122.497 704.474c-14.714-129.987 134.73-252.484 330.735-272.532 196.005-19.939 365.01 70.06 377.243 202.527 14.712 129.987-134.73 252.484-330.68 272.532z m19.563-375.034c-93.072-25.005-198.43 22.527-240.088 107.515-41.605 87.52 0 182.478 93.125 212.496 97.975 32.497 213.142-17.515 252.322-109.995 39.179-92.53-9.81-185.01-105.359-210.016z m-70.976 219.987c-19.616 30.018-61.22 45-90.645 30.018-29.372-14.982-39.18-50.012-19.617-82.455 19.616-30.07 58.796-42.574 88.22-30.07 29.372 15.034 39.18 50.01 22.042 82.507z m63.7-82.455c-7.329 12.45-22.095 17.461-34.275 12.45-12.287-4.958-17.192-17.462-9.809-29.964 4.85-12.503 19.564-17.515 31.797-12.503 12.288 5.011 17.191 17.515 12.288 29.964z m431.137-327.555a83.964 83.964 0 0 0-14.66-74.963c-19.616-19.994-46.562-30.019-71.029-22.527-22.096 5.012-41.658-9.97-46.563-30.018a40.258 40.258 0 0 1 29.426-47.479c51.412-10.023 107.783 5.012 144.537 47.479a157.904 157.904 0 0 1 31.797 152.514c-7.33 19.994-29.372 32.497-48.988 25.006-19.563-5.012-31.796-27.485-24.466-50.012z m227.908 75.018a44.838 44.838 0 0 1-56.37 30.019c-24.521-7.546-36.755-35.032-29.426-57.504a226.13 226.13 0 0 0-46.508-222.52c-56.372-62.515-137.21-87.52-213.144-70.006a45.108 45.108 0 0 1-53.892-35.029c-4.904-24.952 9.754-49.958 34.276-54.97a312.789 312.789 0 0 1 298.884 97.544c78.413 87.467 98.03 207.485 66.18 312.466z\" ></path></symbol><symbol id=\"authing-github\" viewBox=\"0 0 1024 1024\"><path d=\"M51.57 672.155c3.72-6.605 52.236-29.956 126.057 57.307 0.186 0 0.465 0.14 0.79 0.419 5.21 4.326 29.538 39.26 43.307 51.865 58.935 53.307 147.083 12.001 157.13 6.047 4.652-38.282 19.025-68.378 43.027-90.52a290.072 290.072 0 0 1-64.052-10.047 203.832 203.832 0 0 1-61.029-18.048 168.852 168.852 0 0 1-58.052-29.165c-17.35-9.35-33.677-23.444-49.027-42.237a205.367 205.367 0 0 1-40.004-58.284c-10.698-20.095-19.071-45.911-25.072-77.356-6-28.84-8.977-62.005-8.977-99.543 0-68.983 22.979-129.64 69.076-181.924-2.745-5.395-33.026-77.17 7.907-179.969 55.447-1.954 115.173 23.49 185.226 68.332A925.198 925.198 0 0 1 547.008 46.89c56.936 1.907 113.592 9.303 169.132 22.142C739.49 54.984 821.637-1.3 900.249 2.747c37.678 89.45 11.024 170.154 6.977 178.9 46.05 46.236 69.076 104.846 69.076 175.875v6.047c0.326 5.024 0.512 10.094 0.512 15.118 0 27.77-3.163 55.958-9.536 84.473a349.24 349.24 0 0 1-25.025 77.402 282.816 282.816 0 0 1-39.027 57.26 367.242 367.242 0 0 1-49.028 41.26c-18.42 10.56-37.445 20.002-57.074 28.142a1890.865 1890.865 0 0 1-61.076 18.048 1650.986 1650.986 0 0 0-64.052 10.048c30.05 25.49 45.4 66.982 46.05 124.662a3242.148 3242.148 0 0 0-0.464 55.54c0 19.583 0.186 40.282 0.465 62.052-0.651 21.444-0.93 37.724-0.93 48.795 0 11.07 0.279 16.931 0.93 17.536a677.27 677.27 0 0 1-159.084 20.048h-14.978c-54.424 0-107.452-6.651-159.177-20.14-0.698-0.652-0.977-39.214-0.977-115.546-20.7 4.652-157.037 31.538-217.508-69.913-19.304-30.05-35.351-103.405-100.753-136.152-6.93 18.048-28.84 2.652-14-10.047z\" ></path></symbol></svg>'\n","import { useState, useEffect } from 'react'\n// import { inRange, debounce } from 'lodash'\n\nfunction debounce(fn: Function, delay: number, immediate = true) {\n let timer: any\n\n return function (this: any) {\n let context = this\n let args = arguments\n timer && clearTimeout(timer)\n\n if (immediate && !timer) {\n fn.apply(context, args)\n }\n\n timer = setTimeout(function () {\n fn.apply(context, args)\n }, delay)\n }\n}\n\nfunction inRange(n: number, start: number, end?: number): boolean {\n if (end || end === 0) {\n return n >= start && n <= end\n }\n return n >= start\n}\n\nexport enum ScreenSize {\n Mobile = 'mobile',\n Desktop = 'desktop',\n}\nexport const SCREEN_SIZE_RANG: {\n size: ScreenSize\n range: [number, number]\n}[] = [\n {\n size: ScreenSize.Mobile,\n range: [0, 719],\n },\n {\n size: ScreenSize.Desktop,\n range: [720, Infinity],\n },\n]\n\nexport const getScreenSize = () => {\n const viewportWidth = document.body.clientWidth\n return (\n SCREEN_SIZE_RANG.find((item) => inRange(viewportWidth, ...item.range))\n ?.size ?? ScreenSize.Desktop\n )\n}\n\nexport const useScreenSize = () => {\n const [screenSize, setScreenSize] = useState(getScreenSize)\n\n useEffect(() => {\n const onResize = debounce(() => {\n setScreenSize(getScreenSize())\n }, 200)\n window.addEventListener('resize', onResize)\n\n return () => window.removeEventListener('resize', onResize)\n }, [])\n\n return [screenSize]\n}\n","import React, { FC } from 'react'\nimport { getClassnames } from '../../../utils'\nimport './iconfont'\nimport './style.less'\n\nexport const IconFont: FC<{\n type: string\n style?: React.CSSProperties\n className?: string\n}> = ({ type, style, className }) => {\n return (\n <svg\n style={{ ...style }}\n className={getClassnames(['authing-icon', className])}\n >\n <use xlinkHref={`#${type}`}></use>\n </svg>\n )\n}\n","import { requestClient } from './http'\nimport { Lang, Protocol } from '../../../components/AuthingGuard/types'\nimport {\n IAzureAdConnectionConfig,\n ICasConnectionConfig,\n ISamlConnectionConfig,\n OIDCConnectionConfig,\n SocialConnectionItem,\n} from './userPoolConfig'\nimport { i18n } from '../locales'\n\nexport enum ApplicationMfaType {\n SMS = 'SMS',\n EMAIL = 'EMAIL',\n // OTP = 'OTP',\n // FACE = 'FACE',\n // FINGERPRINT = 'FINGERPRINT',\n}\n\nexport const ApplicationMfaTypeLabel: () => Record<\n ApplicationMfaType,\n string\n> = () => ({\n [ApplicationMfaType.SMS]: i18n.t('common.SMS'),\n [ApplicationMfaType.EMAIL]: i18n.t('common.EmailVerification'),\n})\n\nexport interface OidcClientMetadata {\n grant_types: string[]\n client_id: string\n redirect_uris: string[]\n scope: string\n response_types: ResponseType[]\n}\nexport interface InternalExtendsField {\n type: 'internal'\n name: string\n label: string\n inputType: string\n}\n\nexport interface UserExtendsField {\n type: 'user'\n id: string\n name: string\n label: string\n inputType: string\n}\n\nexport type ExtendsField = InternalExtendsField | UserExtendsField\n\nexport interface ApplicationPasswordTabConfig {\n enabledLoginMethods?: PasswordLoginMethods[]\n}\n\nexport interface Agreement {\n id: number\n title: string\n required: boolean\n lang: Lang\n}\n\nexport type PasswordLoginMethods =\n | 'username-password'\n | 'email-password'\n | 'phone-password'\n\nexport interface ApplicationConfig {\n id: string\n cdnBase: string\n userPoolId: string\n rootUserPoolId: string\n publicKey: string\n // 登录框自定义 css 代码\n css: string\n name: string\n logo: string\n description?: string\n redirectUris: string[]\n registerDisabled: boolean\n registerTabs: {\n list: string[]\n default: string\n title: { [x: string]: string }\n }\n loginTabs: {\n list: string[]\n default: string\n defaultV2?: string\n title: { [x: string]: string }\n }\n socialConnections: SocialConnectionItem[]\n\n extendsFieldsEnabled: boolean\n extendsFields: ExtendsField[]\n\n identityProviders: {\n identifier: string\n protocol: Protocol\n displayName: string\n logo: string\n config:\n | ISamlConnectionConfig\n | OIDCConnectionConfig\n | ICasConnectionConfig\n | IAzureAdConnectionConfig\n }[]\n\n ssoPageComponentDisplay: {\n autoRegisterThenLoginHintInfo: boolean\n forgetPasswordBtn: boolean\n idpBtns: boolean\n loginBtn: boolean\n loginByPhoneCodeTab: boolean\n loginByUserPasswordTab: boolean\n loginMethodNav: boolean\n phoneCodeInput: boolean\n registerBtn: boolean\n registerByEmailTab: boolean\n registerByPhoneTab: boolean\n registerMethodNav: boolean\n socialLoginBtns: boolean\n userPasswordInput: boolean\n wxMpScanTab: boolean\n }\n\n protocol: Protocol\n oidcConfig: OidcClientMetadata\n passwordTabConfig: ApplicationPasswordTabConfig\n\n agreementEnabled: boolean\n agreements: Agreement[]\n}\n\nexport const fetchAppConfig = (appId: string) =>\n requestClient.get<ApplicationConfig>(\n `/api/v2/applications/${appId}/public-config`\n )\n","import qs from 'qs'\nimport shortid from 'shortid'\nimport React, { FC, useEffect } from 'react'\nimport { Button, Avatar, Space, Tooltip, message } from 'antd'\n\nimport { isWechatBrowser, popupCenter } from '../../../../utils'\nimport { useGuardContext } from '../../../../context/global/context'\nimport {\n APP_MFA_CODE,\n OTP_MFA_CODE,\n} from '../../../../components/AuthingGuard/constants'\nimport {\n Lang,\n Protocol,\n SocialAndIdpLoginProps,\n} from '../../../../components/AuthingGuard/types'\nimport {\n OIDCConnectionConfig,\n ICasConnectionConfig,\n ISamlConnectionConfig,\n IAzureAdConnectionConfig,\n IOAuthConnectionConfig,\n} from '../../../../components/AuthingGuard/api'\nimport { requestClient } from '../../api/http'\n\nimport './style.less'\nimport { IconFont } from '../../IconFont'\nimport { useScreenSize } from '../../hooks/useScreenSize'\nimport { SocialConnectionProvider } from 'authing-js-sdk'\nimport { useTranslation } from 'react-i18next'\nimport { i18n } from '../../locales'\n\nexport const SocialAndIdpLogin: FC<SocialAndIdpLoginProps> = ({\n onFail = () => {},\n onSuccess = () => {},\n}) => {\n const {\n state: { config, userPoolId, appId, authClient },\n } = useGuardContext()\n const { t } = useTranslation()\n\n const noForm = !config.loginMethods?.length\n\n const [screenSize] = useScreenSize()\n\n useEffect(() => {\n const onMessage = (evt: MessageEvent) => {\n // TODO: event.origin是指发送的消息源,一定要进行验证!!!\n\n const { code, message: errMsg, data, event } = evt.data\n\n const { source, eventType } = event || {}\n\n // 社会化登录是用 authing-js-sdk 实现的,不用再在这里回调了\n if (source === 'authing' && eventType === 'socialLogin') {\n return\n }\n\n try {\n const parsedMsg = JSON.parse(errMsg)\n const { code: authingCode } = parsedMsg\n if ([OTP_MFA_CODE, APP_MFA_CODE].includes(authingCode)) {\n onFail(parsedMsg)\n return\n }\n } catch (e) {\n // do nothing...\n }\n\n if (code !== undefined) {\n if (code === 200) {\n localStorage.setItem('_authing_token', data?.token)\n onSuccess(data)\n } else {\n message.error(errMsg)\n }\n }\n }\n window.addEventListener('message', onMessage)\n return () => {\n window.removeEventListener('message', onMessage)\n }\n }, [onFail, onSuccess])\n\n const idpButtons = config.enterpriseConnectionObjs.map((i) => {\n if (i.protocol === Protocol.OIDC) {\n const configItem = i.config as OIDCConnectionConfig\n const state = shortid.generate()\n\n const query = qs.stringify({\n client_id: configItem.clientId,\n redirect_uri: configItem.redirectUri,\n scope: configItem.scopes,\n response_type: configItem.responseType,\n state,\n nonce: shortid.generate(),\n })\n const url = `${configItem.authorizationEdpoint}?${query}`\n\n return (\n <Button\n key={i.identifier}\n className=\"authing-guard-third-login-btn\"\n block\n size=\"large\"\n icon={<Avatar size={20} src={i.logo} style={{ marginRight: 8 }} />}\n onClick={async () => {\n await requestClient.post(\n '/api/v2/connections/oidc/start-interaction',\n {\n state,\n protocol: i.protocol,\n userPoolId,\n appId,\n referer: window.location.href,\n connection: { providerIentifier: i.identifier },\n }\n )\n popupCenter(url)\n }}\n >\n {t('login.loginBy', {\n name: i.displayName,\n })}\n </Button>\n )\n } else if (i.protocol === Protocol.SAML) {\n const config = i.config as ISamlConnectionConfig\n return (\n <Button\n key={i.identifier}\n className=\"authing-guard-third-login-btn\"\n block\n size=\"large\"\n icon={<Avatar size={20} src={i.logo} style={{ marginRight: 8 }} />}\n onClick={async () => {\n popupCenter(config.samlRequest!)\n }}\n >\n {t('login.loginBy', {\n name: i.displayName,\n })}\n </Button>\n )\n } else if (i.protocol === Protocol.CAS) {\n const config = i.config as ICasConnectionConfig\n\n return (\n <Button\n key={i.identifier}\n className=\"authing-guard-third-login-btn\"\n block\n size=\"large\"\n icon={<Avatar size={20} src={i.logo} style={{ marginRight: 8 }} />}\n onClick={async () => {\n popupCenter(config.casConnectionLoginUrl!)\n }}\n >\n {t('login.loginBy', {\n name: i.displayName,\n })}\n </Button>\n )\n } else if (i.protocol === Protocol.OAUTH) {\n const config = i.config as IOAuthConnectionConfig\n\n return (\n <Button\n key={i.identifier}\n className=\"authing-guard-third-login-btn\"\n block\n size=\"large\"\n icon={<Avatar size={20} src={i.logo} style={{ marginRight: 8 }} />}\n onClick={async () => {\n popupCenter(config.authUrl!)\n }}\n >\n {t('login.loginBy', {\n name: i.displayName,\n })}\n </Button>\n )\n } else if (i.protocol === Protocol.AZURE_AD) {\n const configItem = i.config as IAzureAdConnectionConfig\n return (\n <Button\n key={i.identifier}\n className=\"authing-guard-third-login-btn\"\n block\n size=\"large\"\n icon={<Avatar size={20} src={i.logo} style={{ marginRight: 8 }} />}\n onClick={async () => {\n popupCenter(configItem.authorizationUrl)\n }}\n >\n {t('login.loginBy', {\n name: i.displayName,\n })}\n </Button>\n )\n } else {\n return null\n }\n })\n\n const socialLoginButtons = config.socialConnectionObjs\n .filter((item) =>\n isWechatBrowser()\n ? item.provider === SocialConnectionProvider.WECHATMP\n : item.provider !== SocialConnectionProvider.WECHATMP\n )\n .map((item) => {\n const iconType = `authing-${item.provider.replace(/:/g, '-')}`\n\n const authorization_params: Record<string, any> = {}\n if (item.provider === SocialConnectionProvider.BAIDU) {\n authorization_params.display = screenSize\n }\n\n const onLogin = () => {\n authClient.social.authorize(item.provider, {\n onSuccess(user) {\n onSuccess(user)\n },\n onError(code, msg) {\n try {\n const parsedMsg = JSON.parse(msg)\n const { code: authingCode } = parsedMsg\n if ([OTP_MFA_CODE, APP_MFA_CODE].includes(authingCode)) {\n onFail(parsedMsg)\n return\n }\n } catch (e) {\n // do nothing...\n }\n\n message.error(msg)\n },\n authorization_params,\n })\n }\n\n return noForm ? (\n <Button\n key={item.provider}\n block\n size=\"large\"\n className=\"authing-guard-third-login-btn\"\n icon={\n <IconFont\n type={iconType}\n style={{ fontSize: 20, marginRight: 8 }}\n />\n }\n onClick={onLogin}\n >\n {item.tooltip?.[i18n.language as Lang] || item.name}\n </Button>\n ) : (\n <Tooltip\n key={item.provider}\n title={item.tooltip?.[i18n.language as Lang] || item.name}\n >\n <div className=\"authing-social-login-item\" onClick={onLogin}>\n <IconFont type={iconType} />\n </div>\n </Tooltip>\n )\n })\n\n const idp =\n config.enterpriseConnectionObjs.length > 0 ? (\n <>\n {!noForm && <div className=\"authing-social-login-title\">OR</div>}\n <Space\n size={12}\n className=\"authing-guard-full-width-space\"\n direction=\"vertical\"\n >\n {idpButtons}\n </Space>\n </>\n ) : null\n\n const socialLogin =\n socialLoginButtons.length > 0 && noForm ? (\n <Space\n size={12}\n className=\"authing-guard-full-width-space\"\n direction=\"vertical\"\n >\n {socialLoginButtons}\n </Space>\n ) : (\n socialLoginButtons.length > 0 && (\n <>\n <div className=\"authing-social-login-title\">\n {t('login.thridAccLogin')}\n </div>\n <div className=\"authing-social-login-list\">{socialLoginButtons}</div>\n </>\n )\n )\n\n return (\n <>\n {!noForm && (\n <div\n style={{\n flex: 1,\n minHeight: 26,\n }}\n ></div>\n )}\n <Space\n size={12}\n direction=\"vertical\"\n className=\"authing-guard-full-width-space\"\n >\n {idp}\n {socialLogin}\n </Space>\n </>\n )\n}\n","import React, { forwardRef, useImperativeHandle, useState } from 'react'\nimport { FormInstance, Rule } from 'antd/lib/form'\nimport { Alert, Form, Input, message } from 'antd'\nimport { UserOutlined, SafetyOutlined } from '@ant-design/icons'\n\nimport {\n getRequiredRules,\n getUserRegisterParams,\n VALIDATE_PATTERN,\n} from '../../../../utils'\nimport { useGuardContext } from '../../../../context/global/context'\nimport {\n LoginMethods,\n PhoneCodeLoginFormProps,\n} from '../../../../components/AuthingGuard/types'\nimport { SendPhoneCode } from '../../../../components/AuthingGuard/Forms/SendPhoneCode'\nimport { LoginFormFooter } from '../../../../components/AuthingGuard/Forms/LoginFormFooter'\nimport { useTranslation } from 'react-i18next'\n\nexport const PhoneCodeLoginForm = forwardRef<\n FormInstance,\n PhoneCodeLoginFormProps\n>(({ onSuccess, onFail, onValidateFail }, ref) => {\n const {\n state: { authClient, config, guardEvents },\n } = useGuardContext()\n const { t } = useTranslation()\n\n const rulesMap: Record<string, Rule[]> = {\n phone: getRequiredRules(t('login.inputPhone')).concat({\n pattern: VALIDATE_PATTERN.phone,\n message: t('common.phoneFormateError'),\n }),\n code: getRequiredRules(t('common.inputVerifyCode')),\n }\n\n const [rawForm] = Form.useForm()\n\n const [phone, setPhone] = useState('')\n const [loading, setLoading] = useState(false)\n\n const onFinishFailed = (errorInfo: any) => {\n setLoading(false)\n onValidateFail && onValidateFail(errorInfo)\n }\n\n const onFinish = async (values: any) => {\n if (guardEvents.onBeforeLogin) {\n try {\n const canLogin = await guardEvents.onBeforeLogin(\n {\n type: LoginMethods.PhoneCode,\n data: {\n phone: values.phone,\n code: values.code,\n },\n },\n authClient\n )\n\n if (!canLogin) {\n setLoading(false)\n return\n }\n } catch (e) {\n if (typeof e === 'string') {\n message.error(e)\n } else {\n message.error(e.message)\n }\n setLoading(false)\n return\n }\n }\n\n try {\n const { phone, code } = values\n const user = await authClient.loginByPhoneCode(phone, code, {\n params: getUserRegisterParams(),\n })\n onSuccess && onSuccess(user)\n } catch (error) {\n onFail && onFail(error)\n } finally {\n setLoading(false)\n }\n }\n\n useImperativeHandle(ref, () => rawForm)\n\n return (\n <Form\n form={rawForm}\n onSubmitCapture={() => setLoading(true)}\n onFinishFailed={onFinishFailed}\n onFinish={onFinish}\n >\n {config.autoRegister && (\n <Alert\n message={t('login.phoneAutoRegister')}\n style={{ marginBottom: 24 }}\n />\n )}\n <Form.Item name=\"phone\" rules={rulesMap.phone}>\n <Input\n autoComplete=\"tel\"\n onChange={(e) => {\n setPhone(e.target.value)\n }}\n size=\"large\"\n placeholder={t('login.inputPhone')}\n prefix={<UserOutlined style={{ color: '#ddd' }} />}\n />\n </Form.Item>\n <Form.Item name=\"code\" rules={rulesMap.code}>\n <Input\n size=\"large\"\n placeholder={t('common.inputFourVerifyCode', {\n length: 4,\n })}\n prefix={<SafetyOutlined style={{ color: '#ddd' }} />}\n suffix={<SendPhoneCode phone={phone} />}\n />\n </Form.Item>\n\n <LoginFormFooter\n needRestPwd\n needRegister\n loading={loading}\n ></LoginFormFooter>\n </Form>\n )\n})\n","import React, { FC, useState } from 'react'\nimport { Button, Form, Input, message } from 'antd'\n\nimport { useGuardContext } from '../../../../context/global/context'\nimport { MFACheckPhoneFormProps } from '../../types'\n\nimport './style.less'\nimport { VALIDATE_PATTERN } from '../../../../utils'\nimport { useTranslation } from 'react-i18next'\n\nexport const CheckPhoneForm: FC<MFACheckPhoneFormProps> = ({\n onSuccess,\n mfaToken,\n}) => {\n const {\n state: { authClient },\n } = useGuardContext()\n const { t } = useTranslation()\n\n const [rawForm] = Form.useForm()\n\n const [loading, setLoading] = useState(false)\n\n const onFinish = async ({ phone }: any) => {\n try {\n const bindable = await authClient.mfa.phoneOrEmailBindable({\n mfaToken,\n phone,\n })\n if (!bindable) {\n message.error(\n t('common.unBindEmaileDoc', {\n email: phone,\n })\n )\n return\n }\n onSuccess(phone!)\n } catch (e) {\n // do nothing\n } finally {\n setLoading(false)\n }\n }\n\n return (\n <>\n <h3 className=\"authing-guard-mfa-title\">{t('common.bindPhone')}</h3>\n <p className=\"authing-guard-mfa-tips\">{t('login.bindPhoneInfo')}</p>\n <Form\n className=\"authing-mfa-check-phone-from\"\n form={rawForm}\n onSubmitCapture={() => setLoading(true)}\n onFinish={onFinish}\n onFinishFailed={() => setLoading(false)}\n >\n <Form.Item\n name=\"phone\"\n rules={[\n {\n required: true,\n message: t('login.inputPhone'),\n },\n {\n pattern: VALIDATE_PATTERN.phone,\n message: t('login.phoneError'),\n },\n ]}\n >\n <Input size=\"large\" placeholder={t('login.inputPhone')} />\n </Form.Item>\n\n <Button\n className=\"authing-guard-mfa-confirm-btn\"\n loading={loading}\n block\n htmlType=\"submit\"\n type=\"primary\"\n size=\"large\"\n >\n {t('common.sure')}\n </Button>\n </Form>\n </>\n )\n}\n","import { User } from 'authing-js-sdk'\nimport React, { FC, useState } from 'react'\nimport { Button, Form } from 'antd'\n\nimport { VerifyCodeInput } from '../../../../common/VerifyCodeInput'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { SmsMFAVerifyFormProps } from '../../../../components/AuthingGuard/types'\n\nimport './style.less'\nimport { SendCodeBtn } from '../SendPhoneCode/SendCodeBtn'\nimport { useTranslation } from 'react-i18next'\n\nconst CODE_LEN = 4\n\nexport const VerifyCodeForm: FC<SmsMFAVerifyFormProps> = ({\n onSuccess,\n onFail,\n phone,\n mfaToken,\n sendCodeRef,\n}) => {\n const {\n state: { authClient },\n } = useGuardContext()\n const { t } = useTranslation()\n\n const [rawForm] = Form.useForm()\n\n const [MfaCode, setMFACode] = useState(new Array(CODE_LEN).fill(''))\n const [loading, setLoading] = useState(false)\n const [sending, setSending] = useState(false)\n const [sent, setSent] = useState(false)\n\n const onFinish = async (values: any) => {\n try {\n const user: User = await authClient.mfa.verifyAppSmsMfa({\n mfaToken,\n phone: phone!,\n code: MfaCode.join(''),\n })\n onSuccess && onSuccess(user)\n } catch (e) {\n onFail?.(e)\n } finally {\n setLoading(false)\n }\n }\n\n const sendVerifyCode = async () => {\n setSending(true)\n try {\n await authClient.sendSmsCode(phone!)\n setSent(true)\n return true\n } catch (e) {\n return false\n } finally {\n setSending(false)\n }\n }\n\n return (\n <>\n <h3 className=\"authing-guard-mfa-title\">{t('login.inputPhoneCode')}</h3>\n <p className=\"authing-guard-mfa-tips\">\n {sending\n ? t('login.sendingVerifyCode')\n : sent\n ? `${t('login.verifyCodeSended')} ${phone}`\n : t('login.clickSent')}\n </p>\n <Form\n form={rawForm}\n onSubmitCapture={() => setLoading(true)}\n onFinish={onFinish}\n onFinishFailed={() => setLoading(false)}\n >\n <Form.Item\n name=\"mfaCode\"\n rules={[\n {\n validateTrigger: [],\n validator() {\n if (MfaCode.some((item) => !item)) {\n return Promise.reject(t('login.inputFullMfaCode'))\n }\n return Promise.resolve()\n },\n },\n ]}\n >\n <VerifyCodeInput\n length={CODE_LEN}\n verifyCode={MfaCode}\n setVerifyCode={setMFACode}\n />\n </Form.Item>\n <SendCodeBtn btnRef={sendCodeRef} beforeSend={() => sendVerifyCode()} />\n\n <Button\n className=\"authing-guard-mfa-confirm-btn\"\n loading={loading}\n block\n htmlType=\"submit\"\n type=\"primary\"\n size=\"large\"\n >\n {t('common.sure')}\n </Button>\n </Form>\n </>\n )\n}\n","import React, { FC, useRef, useState } from 'react'\nimport { useGuardContext } from 'src/context/global/context'\nimport { CheckPhoneForm } from './CheckPhoneForm'\nimport { VerifyCodeForm } from './VerifyCodeForm'\nimport { SmsMFAFormProps } from '../../types'\n\nexport const SmsMfaVerifyForm: FC<SmsMFAFormProps> = ({\n onSuccess,\n onFail,\n}) => {\n const {\n state: {\n mfaData: { mfaToken, phone: userPhone },\n },\n } = useGuardContext()\n const [phone, setPhone] = useState(userPhone)\n const sendCodeRef = useRef<HTMLButtonElement>(null)\n\n return (\n <>\n {phone ? (\n <VerifyCodeForm\n sendCodeRef={sendCodeRef}\n onSuccess={onSuccess}\n onFail={onFail}\n phone={phone!}\n mfaToken={mfaToken}\n ></VerifyCodeForm>\n ) : (\n <CheckPhoneForm\n mfaToken={mfaToken}\n onSuccess={(phone) => {\n setPhone(phone)\n sendCodeRef.current?.click()\n }}\n ></CheckPhoneForm>\n )}\n </>\n )\n}\n","import React, { FC, useState } from 'react'\nimport { Button, Form, Input, message } from 'antd'\n\nimport { useGuardContext } from '../../../../context/global/context'\nimport { MFACheckEmailFormProps } from '../../types'\n\nimport './style.less'\nimport { VALIDATE_PATTERN } from '../../../../utils'\nimport { useTranslation } from 'react-i18next'\n\nexport const CheckEmailForm: FC<MFACheckEmailFormProps> = ({\n onSuccess,\n mfaToken,\n}) => {\n const {\n state: { authClient },\n } = useGuardContext()\n\n const { t } = useTranslation()\n\n const [rawForm] = Form.useForm()\n\n const [loading, setLoading] = useState(false)\n\n const onFinish = async ({ email }: any) => {\n try {\n const bindable = await authClient.mfa.phoneOrEmailBindable({\n mfaToken,\n email,\n })\n if (!bindable) {\n message.error(\n t('common.unBindEmaileDoc', {\n email: email,\n })\n )\n return\n }\n onSuccess(email!)\n } catch (e) {\n // do nothing\n } finally {\n setLoading(false)\n }\n }\n\n return (\n <>\n <h3 className=\"authing-guard-mfa-title\">{t('common.bindEmail')}</h3>\n <p className=\"authing-guard-mfa-tips\">{t('common.bindEmailDoc')}</p>\n <Form\n form={rawForm}\n onSubmitCapture={() => setLoading(true)}\n onFinish={onFinish}\n onFinishFailed={() => setLoading(false)}\n >\n <Form.Item\n name=\"email\"\n rules={[\n {\n required: true,\n message: t('login.inputEmail'),\n },\n {\n pattern: VALIDATE_PATTERN.email,\n message: t('login.emailError'),\n },\n ]}\n >\n <Input placeholder={t('login.inputEmail')}></Input>\n </Form.Item>\n\n <Button\n className=\"authing-guard-mfa-confirm-btn\"\n loading={loading}\n block\n htmlType=\"submit\"\n type=\"primary\"\n size=\"large\"\n >\n {t('common.sure')}\n </Button>\n </Form>\n </>\n )\n}\n","import { EmailScene, User } from 'authing-js-sdk'\nimport React, { FC, useState } from 'react'\nimport { Button, Form } from 'antd'\n\nimport { VerifyCodeInput } from '../../../../common/VerifyCodeInput'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { EmailMFAVerifyFormProps } from '../../../../components/AuthingGuard/types'\n\nimport './style.less'\nimport { SendCodeBtn } from '../SendPhoneCode/SendCodeBtn'\nimport { useTranslation } from 'react-i18next'\n\nconst CODE_LEN = 4\n\nexport const VerifyCodeForm: FC<EmailMFAVerifyFormProps> = ({\n onSuccess,\n onFail,\n email,\n mfaToken,\n sendCodeRef,\n}) => {\n const {\n state: { authClient },\n } = useGuardContext()\n\n const { t } = useTranslation()\n\n const [rawForm] = Form.useForm()\n\n const [MfaCode, setMFACode] = useState(new Array(CODE_LEN).fill(''))\n const [loading, setLoading] = useState(false)\n\n const [sending, setSending] = useState(false)\n const [sent, setSent] = useState(false)\n\n const onFinish = async (values: any) => {\n try {\n const user: User = await authClient.mfa.verifyAppEmailMfa({\n mfaToken,\n email: email!,\n code: MfaCode.join(''),\n })\n onSuccess && onSuccess(user)\n } catch (e) {\n onFail?.(e)\n } finally {\n setLoading(false)\n }\n }\n\n const sendVerifyCode = async () => {\n try {\n setSending(true)\n await authClient.sendEmail(email!, EmailScene.MfaVerify)\n setSent(true)\n return true\n } catch (e) {\n return false\n } finally {\n setSending(false)\n }\n }\n\n return (\n <>\n <h3 className=\"authing-guard-mfa-title\">{t('login.inputEmailCode')}</h3>\n <p className=\"authing-guard-mfa-tips\">\n {sending\n ? t('login.sendingVerifyCode')\n : sent\n ? `${t('login.verifyCodeSended')} ${email}`\n : t('login.clickSent')}\n </p>\n <Form\n form={rawForm}\n onSubmitCapture={() => setLoading(true)}\n onFinish={onFinish}\n onFinishFailed={() => setLoading(false)}\n >\n <Form.Item\n name=\"mfaCode\"\n rules={[\n {\n validateTrigger: [],\n validator() {\n if (MfaCode.some((item) => !item)) {\n return Promise.reject(t('login.inputFullMfaCode'))\n }\n return Promise.resolve()\n },\n },\n ]}\n >\n <VerifyCodeInput\n length={CODE_LEN}\n verifyCode={MfaCode}\n setVerifyCode={setMFACode}\n />\n </Form.Item>\n\n <SendCodeBtn btnRef={sendCodeRef} beforeSend={() => sendVerifyCode()} />\n\n <Button\n className=\"authing-guard-mfa-confirm-btn\"\n loading={loading}\n block\n htmlType=\"submit\"\n type=\"primary\"\n size=\"large\"\n >\n {t('common.sure')}\n </Button>\n </Form>\n </>\n )\n}\n","import React, { FC, useRef, useState } from 'react'\nimport { useGuardContext } from 'src/context/global/context'\nimport { CheckEmailForm } from './CheckEmailForm'\nimport { VerifyCodeForm } from './VerifyCodeForm'\nimport { SmsMFAFormProps } from '../../types'\n\nexport const EmailMfaVerifyForm: FC<SmsMFAFormProps> = ({\n onSuccess,\n onFail,\n}) => {\n const {\n state: {\n mfaData: { mfaToken, email: userEmail },\n },\n } = useGuardContext()\n const [email, setEmail] = useState(userEmail)\n const sendCodeRef = useRef<HTMLButtonElement>(null)\n\n return (\n <>\n {email ? (\n <VerifyCodeForm\n sendCodeRef={sendCodeRef}\n onSuccess={onSuccess}\n onFail={onFail}\n email={email!}\n mfaToken={mfaToken}\n ></VerifyCodeForm>\n ) : (\n <CheckEmailForm\n mfaToken={mfaToken}\n onSuccess={(email) => {\n setEmail(email)\n sendCodeRef.current?.click()\n }}\n ></CheckEmailForm>\n )}\n </>\n )\n}\n","import { message } from 'antd'\nimport { User } from 'authing-js-sdk'\nimport React, { FC, useState } from 'react'\n\nimport { Steps } from './Steps'\nimport {\n MfaResetCodeForm,\n MFAVerifyForm,\n} from '../../../components/AuthingGuard/Forms'\nimport { useGuardContext } from '../../../context/global/context'\n\nimport './style.less'\nimport { useTranslation } from 'react-i18next'\n\nexport interface MfaLayoutProps {}\n\nexport const MfaLayout: FC<MfaLayoutProps> = () => {\n const { t } = useTranslation()\n const {\n state: { guardEvents, authClient },\n } = useGuardContext()\n\n const [step, setStep] = useState(Steps.Verify)\n\n const onSuccess = (user: User) => {\n message.success(t('common.LoginSuccess'))\n guardEvents.onLogin?.(user, authClient)\n }\n\n const onFail = (error: any) => {\n guardEvents.onLoginError?.(error, authClient)\n }\n\n const formProps = {\n onSuccess,\n onFail,\n }\n\n const formMap = {\n [Steps.Verify]: (\n <MFAVerifyForm {...formProps} goReset={() => setStep(Steps.Reset)} />\n ),\n [Steps.Reset]: (\n <MfaResetCodeForm {...formProps} goVerify={() => setStep(Steps.Verify)} />\n ),\n }\n\n return <div>{formMap[step]}</div>\n}\n","import { Button } from 'antd'\nimport React, { FC, useMemo } from 'react'\nimport { EllipsisOutlined } from '@ant-design/icons'\n\nimport { getClassnames } from '../../utils'\n\nimport './style.less'\n\nexport interface AuthingTabsProps extends React.HTMLAttributes<HTMLDivElement> {\n activeKey?: string\n onTabClick: (key: string) => void\n showLen?: number\n tabs: {\n key: string\n label: string\n component: JSX.Element\n }[]\n}\n\nexport const AuthingTabs: FC<AuthingTabsProps> = ({\n tabs,\n showLen = 3,\n className,\n activeKey,\n onTabClick,\n}) => {\n const activeIndex = useMemo(\n () => tabs.findIndex((item) => item.key === activeKey),\n [tabs, activeKey]\n )\n\n const showTabs = useMemo(() => {\n if (tabs.length <= showLen) {\n return [...tabs]\n }\n\n let startIndex = Math.max(activeIndex - 1, 0)\n if (startIndex + showLen > tabs.length - 1) {\n startIndex = tabs.length - showLen\n }\n\n return tabs.slice(startIndex, startIndex + showLen)\n }, [showLen, activeIndex, tabs])\n\n const hideTabs = useMemo(() => {\n const showKeys = showTabs.map((item) => item.key)\n return tabs.filter((item) => !showKeys.find((key) => item.key === key))\n }, [tabs, showTabs])\n\n return (\n <>\n <div className={getClassnames(['authing-tabs', className])}>\n <div\n className={getClassnames([\n 'authing-tabs-inner',\n Boolean(hideTabs.length) && 'authing-tabs-inner--more',\n ])}\n >\n {showTabs.map((item, index) => (\n <div\n onClick={() => onTabClick(item.key)}\n className={getClassnames([\n 'authing-tab-item',\n activeKey === item.key && 'authing-tab-item__active',\n ])}\n key={item.key}\n >\n {item.label}\n </div>\n ))}\n </div>\n {Boolean(hideTabs.length) && (\n <Button\n className=\"authing-tabs-show-more\"\n type=\"text\"\n icon={<EllipsisOutlined />}\n >\n <ul className=\"authing-tabs-more-panel\">\n {hideTabs.map((item) => (\n <li\n key={item.key}\n onClick={() => onTabClick(item.key)}\n className=\"authing-tabs-more-panel-item\"\n >\n {item.label}\n </li>\n ))}\n </ul>\n </Button>\n )}\n </div>\n\n <div className=\"authing-tab-pane\">\n {tabs.find((item) => item.key === activeKey)?.component}\n </div>\n </>\n )\n}\n","import { message } from 'antd'\nimport { User } from 'authing-js-sdk'\nimport { FormInstance } from 'antd/lib/form'\nimport React, { useCallback, useRef } from 'react'\n\nimport { useGuardContext } from '../../../context/global/context'\nimport {\n ADLoginForm,\n LdapLoginForm,\n QrCodeLoginForm,\n SocialAndIdpLogin,\n PasswordLoginForm,\n PhoneCodeLoginForm,\n} from '../../../components/AuthingGuard/Forms'\nimport {\n OTP_MFA_CODE,\n APP_MFA_CODE,\n LOGIN_METHODS_MAP,\n} from '../../../components/AuthingGuard/constants'\nimport { AuthingTabs } from '../../../common/AuthingTabs'\nimport {\n BaseFormProps,\n GuardScenes,\n LoginMethods,\n} from '../../../components/AuthingGuard/types'\n\nimport './style.less'\nimport { useTranslation } from 'react-i18next'\n\nconst useFormActions = () => {\n const { t } = useTranslation()\n\n const {\n setValue,\n state: { guardEvents, authClient },\n } = useGuardContext()\n\n const onSuccess = useCallback(\n (user: User) => {\n message.success(t('common.LoginSuccess'))\n guardEvents.onLogin?.(user, authClient)\n },\n [authClient, guardEvents, t]\n )\n\n const onFail = useCallback(\n (error: any) => {\n if (OTP_MFA_CODE === error?.code) {\n setValue('mfaData', error.data)\n setValue('guardScenes', GuardScenes.MfaVerify)\n }\n if (APP_MFA_CODE === error?.code) {\n setValue('mfaData', error.data)\n setValue('guardScenes', GuardScenes.AppMfaVerify)\n }\n guardEvents.onLoginError?.(error, authClient)\n },\n [authClient, guardEvents, setValue]\n )\n\n return {\n onFail,\n onSuccess,\n }\n}\n\nconst useNormalLoginTabs = ({ onSuccess, onFail }: BaseFormProps) => {\n const formRef = useRef<Record<LoginMethods, FormInstance>>(\n {} as Record<LoginMethods, FormInstance>\n )\n\n const formProps = {\n onFail,\n onSuccess,\n }\n\n const LOGIN_FORM_MAP = {\n [LoginMethods.Password]: (props: any) => (\n <PasswordLoginForm\n {...props}\n ref={(v) => (formRef.current[LoginMethods.Password] = v!)}\n />\n ),\n [LoginMethods.PhoneCode]: (props: any) => (\n <PhoneCodeLoginForm\n {...props}\n ref={(v) => (formRef.current[LoginMethods.PhoneCode] = v!)}\n />\n ),\n [LoginMethods.AppQr]: (props: any) => (\n <QrCodeLoginForm type={LoginMethods.AppQr} {...props} />\n ),\n [LoginMethods.WxMinQr]: (props: any) => (\n <QrCodeLoginForm type={LoginMethods.WxMinQr} {...props} />\n ),\n [LoginMethods.LDAP]: (props: any) => (\n <LdapLoginForm\n {...props}\n ref={(v) => (formRef.current[LoginMethods.LDAP] = v!)}\n />\n ),\n [LoginMethods.WechatMpQrcode]: (props: any) => (\n <QrCodeLoginForm type={LoginMethods.WechatMpQrcode} {...props} />\n ),\n [LoginMethods.AD]: (props: any) => (\n <ADLoginForm\n {...props}\n ref={(v) => (formRef.current[LoginMethods.AD] = v!)}\n />\n ),\n }\n\n const {\n state: { config },\n } = useGuardContext()\n const { loginMethods = [], loginMethodTitleMapping } = config\n\n const tabs = loginMethods\n .map((tab) => {\n if (\n !loginMethods.every(\n (item) => !(item.split(':').length > 1 && item.split(':')[0] === tab)\n )\n )\n return undefined\n\n const idpId = tab.split(':').length > 1 ? tab.split(':')[1] : undefined\n\n if (idpId) {\n const type = tab.split(':')[0] as LoginMethods\n return {\n key: tab,\n label: loginMethodTitleMapping[tab]!,\n component: LOGIN_FORM_MAP[type]({\n ...formProps,\n idpId: idpId,\n }),\n }\n } else {\n return {\n key: tab,\n label: LOGIN_METHODS_MAP()?.[tab]!,\n component: LOGIN_FORM_MAP[tab](formProps),\n }\n }\n })\n .filter((i) => i !== undefined)\n\n return {\n tabs,\n }\n}\n\nconst SHOW_SOCIAL_LOGIN_TAB = [\n LoginMethods.LDAP,\n LoginMethods.Password,\n LoginMethods.PhoneCode,\n]\nexport const LoginLayout = () => {\n const {\n state: { activeTabs },\n setValue,\n } = useGuardContext()\n\n const { onFail, onSuccess } = useFormActions()\n const { tabs } = useNormalLoginTabs({ onSuccess, onFail })\n\n return (\n <>\n <AuthingTabs\n tabs={\n tabs as {\n key: LoginMethods\n label: string\n component: JSX.Element\n }[]\n }\n onTabClick={(t) =>\n setValue('activeTabs', {\n ...activeTabs,\n [GuardScenes.Login]: t,\n })\n }\n activeKey={activeTabs[GuardScenes.Login]}\n />\n\n {SHOW_SOCIAL_LOGIN_TAB.includes(activeTabs[GuardScenes.Login]) && (\n <SocialAndIdpLogin onFail={onFail} onSuccess={onSuccess} />\n )}\n </>\n )\n}\n","import { message } from 'antd'\nimport { User } from 'authing-js-sdk'\nimport React, { FC } from 'react'\n\nimport { useGuardContext } from '../../../context/global/context'\nimport {\n GuardScenes,\n LoginMethods,\n RegisterMethods,\n} from '../../../components/AuthingGuard/types'\nimport { AuthingTabs } from '../../../common/AuthingTabs'\nimport { REGISTER_METHODS_MAP } from '../../../components/AuthingGuard/constants'\nimport {\n EmailRegisterForm,\n PhoneRegisterForm,\n} from '../../../components/AuthingGuard/Forms'\nimport { useTranslation } from 'react-i18next'\n\nexport const RegisterLayout: FC = () => {\n const {\n state: {\n config: { registerMethods, extendsFields, loginMethods = [] },\n activeTabs,\n guardEvents,\n authClient,\n },\n setValue,\n } = useGuardContext()\n\n const { t } = useTranslation()\n const onSuccess = (user: User) => {\n message.success(t('common.registrationSuccess'))\n if (extendsFields?.length > 0) {\n setValue('guardScenes', GuardScenes.CompleteUserInfo)\n } else {\n setValue('guardScenes', GuardScenes.Login)\n }\n guardEvents.onRegister?.(user, authClient)\n }\n\n const onFail = (error: any) => {\n guardEvents.onRegisterError?.(error, authClient)\n }\n\n const formProps = {\n onSuccess,\n onFail,\n }\n\n const onTabClick = (t: string) => {\n const next = {\n ...activeTabs,\n [GuardScenes.Register]: t,\n }\n switch (t) {\n case RegisterMethods.Email:\n loginMethods.includes(LoginMethods.Password) &&\n (next[GuardScenes.Login] = LoginMethods.Password)\n break\n case RegisterMethods.Phone:\n loginMethods.includes(LoginMethods.PhoneCode) &&\n (next[GuardScenes.Login] = LoginMethods.PhoneCode)\n break\n default:\n break\n }\n\n setValue('activeTabs', next)\n }\n\n const REGISTER_FORM_MAP = {\n [RegisterMethods.Email]: <EmailRegisterForm {...formProps} />,\n [RegisterMethods.Phone]: <PhoneRegisterForm {...formProps} />,\n }\n\n const tabs = registerMethods!.map((item) => ({\n key: item,\n label: REGISTER_METHODS_MAP()[item],\n component: REGISTER_FORM_MAP[item],\n }))\n\n return (\n <AuthingTabs\n activeKey={activeTabs[GuardScenes.Register]}\n onTabClick={onTabClick}\n tabs={tabs}\n ></AuthingTabs>\n )\n}\n","import React from 'react'\n\nimport { useGuardContext } from '../../../context/global/context'\nimport { ResetPasswordForm } from '../../../components/AuthingGuard/Forms'\n\nexport const ResetPwdLayout = () => {\n const {\n state: { guardEvents, authClient },\n } = useGuardContext()\n\n const onFail = (error: any) => {\n guardEvents.onPwdResetError?.(error, authClient)\n }\n\n const onSuccess = () => {\n guardEvents.onPwdReset?.(authClient)\n }\n\n return <ResetPasswordForm onFail={onFail} onSuccess={onSuccess} />\n}\n","import { Lang, Protocol } from '../../../components/AuthingGuard/types'\nimport { SocialConnectionProvider } from 'authing-js-sdk'\n\nexport interface OIDCConnectionConfig {\n issuerUrl: string\n authorizationEdpoint: string\n responseType: string\n mode: OIDCConnectionMode\n clientId: string\n clientSecret: string\n scopes: string\n redirectUri: string\n}\n\nexport interface IOAuthConnectionConfig {\n authEndPoint: string\n tokenEndPoint: string\n scope: string\n clientId: string\n clientSecret: string\n authUrlTemplate: string\n codeToTokenScript: string\n tokenToUserInfoScript: string\n tokenToUserInfoScriptFuncId: string\n codeToTokenScriptFuncId: string\n authUrl?: string // 根据模板拼接出来的授权 url\n}\n\nexport interface IAzureAdConnectionConfig {\n microsoftAzureAdDomain: string\n clientId: string\n syncUserProfileOnLogin: string\n emailVerifiedDefault: boolean\n authorizationUrl: string\n callbackUrl: string\n}\n\nexport enum OIDCConnectionMode {\n FRONT_CHANNEL = 'FRONT_CHANNEL',\n BACK_CHANNEL = 'BACK_CHANNEL',\n}\n\nexport interface ISamlConnectionConfig {\n signInEndPoint: string\n samlRequest?: string\n\n // saml assertion 验签公钥\n\n samlIdpCert: string\n\n // saml request 验签公钥\n\n samlSpCert: string\n\n // saml request 签名私钥\n\n samlSpKey: string\n\n signOutEndPoint: string\n\n signSamlRequest: boolean\n\n signatureAlgorithm: string\n\n digestAlgorithm: string\n\n protocolBinding: string\n}\n\nexport interface ICasConnectionConfig {\n casConnectionLoginUrl: string\n}\nexport interface SocialConnectionItem {\n name: string\n logo: string\n description: string\n provider: SocialConnectionProvider\n authorizationUrl: string\n tooltip: Record<Lang, string>\n}\n\nexport interface EnterpriseConnectionItem {\n id: string\n createdAt: Date\n updatedAt: Date\n userPoolId: string\n protocol: Protocol\n identifier: string\n displayName: string\n logo: string\n enabled: boolean\n config:\n | OIDCConnectionConfig\n | ISamlConnectionConfig\n | ICasConnectionConfig\n | IAzureAdConnectionConfig\n | IOAuthConnectionConfig\n}\n\nexport interface UserPoolConfig {\n name: string\n logo: string\n socialConnections: SocialConnectionItem[]\n enterpriseConnections: EnterpriseConnectionItem[]\n}\n\n// export const fetchUserPoolConfig = (userPoolId: string) =>\n// requestClient.get<UserPoolConfig>(\n// `/api/v2/userpools/${userPoolId}/public-config`\n// )\n","import { PlusOutlined } from '@ant-design/icons'\nimport { message, Spin, Upload } from 'antd'\nimport { UploadChangeParam } from 'antd/lib/upload'\nimport React, { FC, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useGuardContext } from '../../../../context/global/context'\n\nexport const UploadImage: FC<{\n value?: string\n onChange?: (value: string) => void\n}> = ({ value, onChange }) => {\n const [uploading, setUploading] = useState(false)\n const { t } = useTranslation()\n const {\n state: {\n config: { apiHost },\n },\n } = useGuardContext()\n\n const onStatusChange = (info: UploadChangeParam) => {\n const { status } = info.file\n\n if (status === 'uploading') {\n setUploading(true)\n } else {\n setUploading(false)\n }\n\n if (status === 'done') {\n const { code, message: errMsg, data } = info.file.response\n if (code !== 200) {\n return message.error(errMsg)\n }\n const { url } = data\n onChange?.(url)\n } else if (status === 'error') {\n message.error(\n t('common.uploadFail', {\n name: info.file.name,\n })\n )\n }\n }\n\n const uploadButton = (\n <div>\n <PlusOutlined />\n <div style={{ marginTop: 8 }}>Upload</div>\n </div>\n )\n\n return (\n <Upload\n name=\"file\"\n accept=\"image/*\"\n listType=\"picture-card\"\n showUploadList={false}\n action={`${apiHost}/api/v2/upload?folder=photos`}\n onChange={onStatusChange}\n >\n <Spin size=\"small\" spinning={uploading}>\n {value ? (\n <img src={value} alt=\"\" style={{ width: '100%' }} />\n ) : (\n uploadButton\n )}\n </Spin>\n </Upload>\n )\n}\n","import { Button, Form, Input, message, Spin } from 'antd'\nimport { useForm } from 'antd/lib/form/Form'\nimport React, { FC, useEffect, useState } from 'react'\nimport { useGuardContext } from '../../../../context/global/context'\nimport { User } from 'authing-js-sdk'\nimport { UploadImage } from '../UploadImage'\nimport { requestClient } from '../../api/http'\nimport { CompleteUserInfoFormProps } from '../../types'\nimport { useTranslation } from 'react-i18next'\nimport { i18n } from '../../locales'\n\nexport const CompleteUserInfoForm: FC<CompleteUserInfoFormProps> = ({\n onSuccess,\n}) => {\n const { t } = useTranslation()\n const [rawForm] = useForm()\n const [submitting, setSubmitting] = useState(false)\n\n const [loading, setLoading] = useState(false)\n\n const {\n state: { config, authClient, guardEvents, userPoolId },\n } = useGuardContext()\n\n const { extendsFields } = config\n\n const [, setUser] = useState<User | null>()\n const [definitions, setDefinitions] = useState<any[]>([])\n\n const onFinish = async (values: any) => {\n const internalFields: any = {}\n const userFields: any[] = []\n Object.entries(values).forEach(([key, value]) => {\n const [type, nameOrId] = key.split(' ')\n if (type === 'internal') {\n internalFields[nameOrId] = value\n } else if (type === 'user') {\n userFields.push({ nameOrId, value })\n }\n })\n\n const udfs = userFields.map(({ nameOrId, value }) => ({\n definition: definitions.find((def) => def.id === nameOrId),\n value,\n }))\n\n try {\n const user = await authClient.updateProfile(internalFields)\n\n setUser(user)\n\n await requestClient.post(\n `/api/v2/udfs/values`,\n {\n udfs,\n },\n {\n headers: {\n authorization: user?.token,\n 'x-authing-userpool-id': userPoolId,\n },\n }\n )\n\n message.success(t('common.saveSuccess'))\n guardEvents.onRegisterInfoCompleted?.(user, udfs, authClient)\n onSuccess?.(user)\n } catch (e) {\n guardEvents.onRegisterInfoCompletedError?.(e, udfs, authClient)\n setSubmitting(false)\n } finally {\n setSubmitting(false)\n }\n }\n\n useEffect(() => {\n setLoading(true)\n ;(async () => {\n const user = await authClient.getCurrentUser()\n setUser(user)\n const { data } = await requestClient.get<any>(\n '/api/v2/udfs/definitions',\n undefined,\n {\n headers: {\n authorization: user?.token!,\n 'x-authing-userpool-id': userPoolId,\n },\n }\n )\n setDefinitions(data)\n setLoading(false)\n })()\n }, [authClient, userPoolId])\n\n const onFinishFailed = () => {}\n\n const INPUT_MAP: Record<string, React.ReactNode | undefined> = {\n image: <UploadImage />,\n }\n\n const formFields = extendsFields.map((def) => {\n const key = `${def.type} ${def.type === 'internal' ? def.name : def.id}`\n\n const label = i18n.language === 'zh-CN' ? def.label : def.name\n\n return (\n <Form.Item key={key} name={key} label={label} style={{ marginBottom: 8 }}>\n {INPUT_MAP[def.inputType] || (\n <Input type={def.inputType} size=\"large\" />\n )}\n </Form.Item>\n )\n })\n\n return (\n <Spin spinning={loading}>\n <Form\n layout=\"vertical\"\n form={rawForm}\n onSubmitCapture={() => setSubmitting(true)}\n onFinishFailed={onFinishFailed}\n onFinish={onFinish}\n >\n {formFields}\n\n <Button\n size=\"large\"\n loading={submitting}\n type=\"primary\"\n block\n htmlType=\"submit\"\n >\n {t('common.problem.form.submit')}\n </Button>\n </Form>\n </Spin>\n )\n}\n","import React, { FC } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useGuardContext } from '../../../context/global/context'\nimport { CompleteUserInfoForm } from '../Forms/CompleteUserInfoForm'\n\nimport './style.less'\n\nexport const CompleteUserInfoLayout: FC = () => {\n const {\n state: { guardTitle },\n } = useGuardContext()\n\n const { t } = useTranslation()\n return (\n <div>\n <h2 className=\"authing-guard-complete-info-title\">\n {t('common.perfectUserInfo')}\n </h2>\n\n <p className=\"authing-guard-complete-info-msg\">\n {t('common.welcomeDoc', {\n name: guardTitle,\n })}\n </p>\n\n <CompleteUserInfoForm />\n </div>\n )\n}\n","import { DownOutlined } from '@ant-design/icons'\nimport React, { FC, useState } from 'react'\nimport { getClassnames } from '../../utils'\n\nimport './style.less'\n\n/**\n * 不使用 antd 的 dropdown,因为里面会用 tooltip,体积过大\n */\nexport const AuthingDropdown: FC<{\n className?: string\n menus: {\n label: React.ReactNode\n key: string | number\n onClick?: (\n key: string | number,\n evt: React.MouseEvent<HTMLDivElement, MouseEvent>\n ) => void\n }[]\n}> = ({ menus, children, className }) => {\n const [visible, setVisible] = useState(false)\n\n return (\n <div\n className={getClassnames(['authing-dropdown', className])}\n onMouseEnter={() => setVisible(true)}\n onMouseLeave={() => setVisible(false)}\n >\n <div className=\"authing-dropdown-trigger\">{children}</div>\n <div\n className={getClassnames([\n 'authing-dropdown-menu-container',\n visible && 'authing-dropdown-menu-container__visible',\n ])}\n >\n {menus.map((item) => (\n <div\n className=\"authing-dropdown-menu-item\"\n onClick={(evt) => {\n setVisible(false)\n item.onClick?.(item.key, evt)\n }}\n key={item.key}\n >\n {item.label}\n </div>\n ))}\n </div>\n <DownOutlined className=\"authing-dropdown-icon\" />\n </div>\n )\n}\n","import { message } from 'antd'\nimport { User } from 'authing-js-sdk'\nimport React, { FC, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { AuthingDropdown } from 'src/common/AuthingDropdown'\n\nimport {\n EmailMfaVerifyForm,\n SmsMfaVerifyForm,\n} from '../../../components/AuthingGuard/Forms'\nimport { useGuardContext } from '../../../context/global/context'\nimport { ApplicationMfaType, ApplicationMfaTypeLabel } from '../api'\n\nimport './style.less'\n\nexport interface MfaLayoutProps {}\n\nexport const AppMfaLayout: FC<MfaLayoutProps> = () => {\n const { t } = useTranslation()\n const {\n state: { guardEvents, authClient, mfaData },\n } = useGuardContext()\n\n const [type, setType] = useState(ApplicationMfaType.SMS)\n\n const onSuccess = (user: User) => {\n message.success(t('common.LoginSuccess'))\n guardEvents.onLogin?.(user, authClient)\n }\n\n const onFail = (error: any) => {\n guardEvents.onLoginError?.(error, authClient)\n }\n\n const formProps = {\n onSuccess,\n onFail,\n }\n\n const formMap = {\n [ApplicationMfaType.EMAIL]: <EmailMfaVerifyForm {...formProps} />,\n [ApplicationMfaType.SMS]: <SmsMfaVerifyForm {...formProps} />,\n }\n\n const availableMfaType = mfaData.applicationMfa\n ?.filter(\n (item) =>\n item.status && Object.keys(ApplicationMfaType).includes(item.mfaPolicy)\n )\n ?.sort((a, b) => a.sort - b.sort)\n ?.map((item) => ({\n label: ApplicationMfaTypeLabel()[item.mfaPolicy],\n key: item.mfaPolicy,\n onClick() {\n setType(item.mfaPolicy)\n },\n }))\n\n return (\n <div className=\"authing-text-center\">\n {formMap[type]}\n {(availableMfaType?.length || 0 > 1) && (\n <AuthingDropdown\n className=\"toggle-mfa-dropdown\"\n menus={availableMfaType!}\n >\n <span className=\"authing-toggle-mfa\">\n {t('login.otherVerifyWay')}\n </span>\n </AuthingDropdown>\n )}\n </div>\n )\n}\n","import React, { FC } from 'react'\nimport { Dropdown, Menu, Space } from 'antd'\nimport { LANG_MAP } from '../types'\nimport { useTranslation } from 'react-i18next'\nimport { changeLang } from '../locales'\nimport { useGuardContext } from '../../../context/global/context'\nimport { IconFont } from '../IconFont'\n\nexport const ToggleLang: FC = () => {\n const {\n state: { authClient },\n } = useGuardContext()\n\n const onClick = ({ key }: any) => {\n changeLang(key)\n authClient.setLang(key)\n }\n const { i18n } = useTranslation()\n\n return (\n <Dropdown\n className=\"authing-toggle-language\"\n overlay={\n <Menu onClick={onClick}>\n {LANG_MAP.map((item) => (\n <Menu.Item key={item.value}>{item.label}</Menu.Item>\n ))}\n </Menu>\n }\n >\n <Space\n size={1}\n style={{\n alignSelf: 'center',\n color: '#999',\n marginTop: 24,\n cursor: 'pointer',\n fontSize: 14,\n }}\n >\n <IconFont type=\"authing-yuyan\" />\n <span>\n {\n LANG_MAP.find((item) => item.value === (i18n.language || 'zh-CN'))\n ?.label\n }\n </span>\n </Space>\n </Dropdown>\n )\n}\n","import { message, Spin } from 'antd'\nimport React, { FC, useCallback, useEffect, useMemo, useState } from 'react'\n\nimport {\n getClassnames,\n insertStyles,\n deepMerge,\n removeStyles,\n} from '../../../utils'\nimport { useGuardContext } from '../../../context/global/context'\nimport { GuardHeader } from '../../../components/AuthingGuard/Header'\nimport { MfaLayout } from '../../../components/AuthingGuard/MfaLayout'\nimport { LoginLayout } from '../../../components/AuthingGuard/LoginLayout'\nimport {\n defaultGuardConfig,\n HIDE_SOCIALS,\n} from '../../../components/AuthingGuard/constants'\nimport { RegisterLayout } from '../../../components/AuthingGuard/RegisterLayout'\nimport { ResetPwdLayout } from '../../../components/AuthingGuard/ResetPwdLayout'\nimport {\n SessionData,\n trackSession,\n fetchAppConfig,\n ApplicationConfig,\n SocialConnectionItem,\n} from '../../../components/AuthingGuard/api'\nimport {\n GuardMode,\n GuardScenes,\n GuardConfig,\n UserConfig,\n Lang,\n} from '../../../components/AuthingGuard/types'\n\nimport './style.less'\nimport { CompleteUserInfoLayout } from '../CompleteUserInfoLayout'\nimport { AppMfaLayout } from '../AppMFALayout'\nimport { IconFont } from '../IconFont'\nimport { ToggleLang } from '../ToggleLang'\nimport { useTranslation } from 'react-i18next'\nimport i18n from 'i18next'\nimport { changeLang } from '../locales'\n\nconst checkConfig = (appId: string) => {\n // 不要去掉 console.warn,不然 vue 版打包出来每次都会 throw error,估计是 rollup 打包有问题\n if (!appId) {\n console.warn('APP ID: ', appId)\n throw new Error(i18n.t('common.unAppId'))\n }\n}\n\nconst useGuardConfig = () => {\n const {\n state: { appId, userConfig },\n setValue,\n } = useGuardContext()\n\n const { t } = useTranslation()\n\n const [loading, setLoading] = useState(true)\n\n const [appConfig, setAppConfig] = useState<Partial<ApplicationConfig>>({})\n const [errorMsg, setErrorMsg] = useState('')\n const [errorDetail, setErrorDetail] = useState<any>()\n\n useEffect(() => {\n try {\n checkConfig(appId)\n\n setErrorDetail(null)\n setErrorMsg('')\n } catch (e: any) {\n setErrorDetail(e)\n setErrorMsg(e.message)\n console.error(e)\n }\n }, [appId])\n\n // 获取应用配置\n useEffect(() => {\n setLoading(true)\n\n if (!appId) {\n setLoading(false)\n return\n }\n fetchAppConfig(appId)\n .then((res) => {\n if (res.code !== 200) {\n setErrorMsg(res.message!)\n setErrorDetail(res)\n return\n }\n\n setAppConfig(res.data!)\n setValue('userPoolId', res.data?.userPoolId)\n })\n .catch((e: any) => {\n setErrorDetail(e)\n setErrorMsg(t('common.networkError'))\n })\n .finally(() => {\n setLoading(false)\n })\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [appId])\n\n useEffect(() => {\n // 先移除之前的\n removeStyles('appConfig')\n removeStyles('userConfig')\n\n insertStyles(appConfig?.css, 'appConfig')\n insertStyles(userConfig.contentCss, 'userConfig')\n }, [appConfig, userConfig.contentCss])\n\n const guardConfig = useMemo<GuardConfig>(() => {\n /**\n * 将用应用配置与用户手动传入的配置合并\n * 优先级:用户传入 > 应用 > 用户池\n */\n\n // 社会化登录\n let socialConnectionObjs: SocialConnectionItem[] | undefined\n // 默认展示所有社会化登录\n if (!userConfig.socialConnections) {\n socialConnectionObjs = [...(appConfig.socialConnections || [])]\n } else {\n const socials = userConfig.socialConnections\n socialConnectionObjs = appConfig.socialConnections?.filter?.((item) =>\n socials.includes(item.provider)\n )\n }\n\n // 某些社会化登录会在 tabs 中显示,或者无法在 Guard 中使用,所以底部不显示了\n socialConnectionObjs = socialConnectionObjs?.filter(\n (item) => !HIDE_SOCIALS.includes(item.provider)\n )\n\n // 企业身份源\n let enterpriseConnectionObjs: ApplicationConfig['identityProviders']\n\n if (userConfig.enterpriseConnections) {\n enterpriseConnectionObjs =\n appConfig.identityProviders?.filter?.((item) =>\n userConfig.enterpriseConnections!.includes(item.identifier)\n ) || []\n } else {\n enterpriseConnectionObjs = appConfig.identityProviders || []\n }\n\n // 登录方式\n const loginMethods =\n userConfig.loginMethods ||\n appConfig.loginTabs?.list ||\n defaultGuardConfig.loginMethods\n\n // 账密登录的登录拆分\n const passwordLoginMethods =\n userConfig.passwordLoginMethods ||\n appConfig.passwordTabConfig?.enabledLoginMethods ||\n defaultGuardConfig.loginMethods\n\n // 默认登录方式\n const defaultLoginMethod =\n userConfig.defaultLoginMethod ||\n appConfig.loginTabs?.defaultV2 ||\n appConfig.loginTabs?.default ||\n defaultGuardConfig.defaultLoginMethod\n\n const loginMethodTitleMapping = appConfig.loginTabs?.title\n\n // 注册方式\n const registerMethods =\n userConfig.registerMethods ||\n appConfig.registerTabs?.list ||\n defaultGuardConfig.registerMethods\n // 默认注册方式\n const defaultRegisterMethod =\n userConfig.defaultRegisterMethod ||\n appConfig.registerTabs?.default ||\n defaultGuardConfig.defaultRegisterMethod\n\n // 应用名\n const title = loading\n ? ''\n : userConfig.title ?? appConfig.name ?? defaultGuardConfig.title\n\n const description = loading ? '' : appConfig.description ?? ''\n\n // 应用 logo\n const logo = loading\n ? ''\n : userConfig.logo ?? appConfig.logo ?? defaultGuardConfig.logo\n\n // 是否自动注册\n const autoRegister =\n userConfig.autoRegister ??\n appConfig.ssoPageComponentDisplay?.autoRegisterThenLoginHintInfo ??\n defaultGuardConfig.autoRegister\n\n // 禁止注册\n const disableRegister =\n userConfig.disableRegister ??\n !(\n appConfig.ssoPageComponentDisplay?.registerBtn ??\n !defaultGuardConfig.disableRegister\n )\n\n // 禁止重置密码\n const disableResetPwd =\n userConfig.disableResetPwd ??\n !(\n appConfig.ssoPageComponentDisplay?.registerBtn ??\n !defaultGuardConfig.disableResetPwd\n )\n\n return deepMerge<GuardConfig>(\n {} as GuardConfig,\n defaultGuardConfig,\n userConfig,\n {\n logo,\n title,\n description,\n autoRegister,\n loginMethods,\n passwordLoginMethods,\n extendsFields: appConfig.extendsFields,\n disableRegister,\n disableResetPwd,\n registerMethods,\n defaultLoginMethod,\n socialConnectionObjs,\n defaultRegisterMethod,\n enterpriseConnectionObjs,\n publicKey: appConfig.publicKey,\n agreementEnabled: appConfig.agreementEnabled,\n agreements: appConfig.agreements,\n loginMethodTitleMapping: loginMethodTitleMapping,\n }\n )\n }, [\n userConfig,\n appConfig.loginTabs?.list,\n appConfig.loginTabs?.default,\n appConfig.loginTabs?.title,\n appConfig.passwordTabConfig?.enabledLoginMethods,\n appConfig.registerTabs?.list,\n appConfig.registerTabs?.default,\n appConfig.name,\n appConfig.description,\n appConfig.logo,\n appConfig.ssoPageComponentDisplay?.autoRegisterThenLoginHintInfo,\n appConfig.ssoPageComponentDisplay?.registerBtn,\n appConfig.extendsFields,\n appConfig.publicKey,\n appConfig.agreementEnabled,\n appConfig.agreements,\n appConfig.socialConnections,\n appConfig.identityProviders,\n loading,\n ])\n\n return {\n loading,\n errorMsg,\n guardConfig,\n errorDetail,\n }\n}\n\nconst useModal = (visible?: boolean) => {\n const {\n state: { userConfig },\n } = useGuardContext()\n\n const isModal = userConfig.mode === GuardMode.Modal\n // 传入了 visible 则为受控组件\n const isControlled = typeof visible !== 'undefined'\n\n // modal 模式,没传 visible,默认为 true\n const [localVisible, setLocalVisible] = useState(\n isModal && isControlled ? visible : true\n )\n\n const toggleLocalVisible = () => {\n setLocalVisible((v) => !v)\n }\n\n const realVisible = useMemo(() => {\n return isControlled ? visible : localVisible\n }, [isControlled, localVisible, visible])\n\n return {\n isModal,\n realVisible,\n isControlled,\n toggleLocalVisible,\n }\n}\n\nexport const GuardLayout: FC<{\n visible?: boolean\n className?: string\n id?: string\n style?: React.CSSProperties\n lang?: Lang\n // 这个传下是为了响应 config 变化,好蠢,以后优化\n userConfig: UserConfig\n}> = ({\n visible,\n id,\n className,\n style,\n lang,\n userConfig: reactiveUserConfig,\n}) => {\n const { t } = useTranslation()\n const {\n state: { guardScenes, authClient, guardEvents, activeTabs, localesConfig },\n setValue,\n } = useGuardContext()\n\n const { realVisible, isControlled, toggleLocalVisible } = useModal(visible)\n\n const { loading, errorMsg, guardConfig, errorDetail } = useGuardConfig()\n\n useEffect(() => {\n if (lang) {\n authClient.setLang(lang)\n changeLang(lang)\n }\n }, [authClient, lang])\n\n useEffect(() => {\n if (!loading) {\n guardEvents.onLoginTabChange?.(activeTabs.login)\n }\n }, [activeTabs.login, loading, guardEvents])\n\n useEffect(() => {\n if (!loading) {\n guardEvents.onRegisterTabChange?.(activeTabs.register)\n }\n }, [activeTabs.register, loading, guardEvents])\n\n useEffect(() => {\n setValue('userConfig', reactiveUserConfig)\n }, [reactiveUserConfig, setValue])\n\n // 动画完成后完全隐藏 dom\n const [hidden, setHidden] = useState(false)\n useEffect(() => {\n setHidden(false)\n }, [realVisible])\n\n const closeHandler = useCallback(() => {\n if (!isControlled && realVisible) {\n toggleLocalVisible()\n }\n guardEvents.onClose?.()\n }, [isControlled, guardEvents, toggleLocalVisible, realVisible])\n\n useEffect(() => {\n if (loading) {\n return\n }\n if (errorDetail) {\n guardEvents.onLoadError?.(errorDetail)\n return\n }\n\n guardEvents.onLoad?.(authClient)\n }, [authClient, errorDetail, guardEvents, loading, t])\n\n useEffect(() => {\n if (guardConfig.isSSO) {\n trackSession().then((sessionData) => {\n // 这个接口没有 code, data, 直接返回了数据\n let typedData = (sessionData as unknown) as SessionData\n if (typedData.userInfo) {\n message.success(t('common.LoginSuccess'))\n guardEvents.onLogin?.(typedData.userInfo, authClient)\n }\n })\n }\n }, [guardConfig.isSSO, guardEvents, authClient, t])\n\n useEffect(() => {\n setValue('config', guardConfig)\n setValue('activeTabs', {\n [GuardScenes.Login]: guardConfig.defaultLoginMethod,\n [GuardScenes.Register]: guardConfig.defaultRegisterMethod,\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [guardConfig])\n\n const isModal = useMemo(() => guardConfig.mode === GuardMode.Modal, [\n guardConfig,\n ])\n\n // 监听 esc 关闭 modal\n useEffect(() => {\n const handler = (evt: KeyboardEvent) => {\n if (evt.keyCode === 27 && isModal && guardConfig.escCloseable) {\n closeHandler()\n }\n }\n\n window.addEventListener('keydown', handler)\n return () => window.removeEventListener('keydown', handler)\n }, [closeHandler, guardConfig, isModal])\n\n const layoutMap = {\n [GuardScenes.Login]: <LoginLayout />,\n [GuardScenes.Register]: <RegisterLayout />,\n [GuardScenes.RestPassword]: <ResetPwdLayout />,\n [GuardScenes.MfaVerify]: <MfaLayout />,\n [GuardScenes.CompleteUserInfo]: <CompleteUserInfoLayout />,\n [GuardScenes.AppMfaVerify]: <AppMfaLayout />,\n }\n\n return (\n <div\n id={id}\n style={{\n ...style,\n zIndex: guardConfig.zIndex || 100,\n }}\n className={getClassnames([\n 'authing-guard-layout',\n !realVisible && 'authing-guard-layout__hidden',\n isModal && 'authing-guard-layout__modal',\n hidden && 'authing-guard-layout__dis-none',\n className,\n ])}\n onTransitionEnd={() => {\n if (!realVisible) {\n setHidden(true)\n }\n }}\n >\n <>\n {isModal && (\n <div\n className={getClassnames([\n 'authing-guard-mask',\n !realVisible && 'authing-guard-mask__hidden',\n ])}\n ></div>\n )}\n <div\n className={getClassnames([\n 'authing-guard-container',\n !realVisible && 'authing-guard-container__hidden',\n ])}\n >\n {isModal && guardConfig.clickCloseable && (\n <button onClick={closeHandler} className=\"authing-guard-close-btn\">\n <IconFont type=\"authing-guanbi\" />\n </button>\n )}\n\n <GuardHeader />\n\n {loading ? (\n <Spin size=\"large\" className=\"authing-guard-loading\" />\n ) : errorMsg ? (\n <div className=\"authing-guard-load-error\">{errorMsg}</div>\n ) : (\n layoutMap[guardScenes]\n )}\n {/* <div>{localesConfig?.isShowChange && <ToggleLang />}</div> */}\n <div>\n {localesConfig?.isShowChange === false ? null : <ToggleLang />}\n </div>\n </div>\n </>\n </div>\n )\n}\n","import { User } from '../types'\nimport { requestClient } from './http'\n\nexport interface SessionData {\n session: null | {\n _id: string\n cookie: {\n originalMaxAge: number\n expires: Date\n secure: boolean\n httpOnly: boolean\n path: string\n sameSite: string\n }\n appId?: string\n type: string\n userId: string\n }\n userInfo?: User\n}\n\nexport const trackSession = () =>\n requestClient.get<SessionData>(\n `/cas/session`,\n {},\n {\n credentials: 'include',\n }\n )\n","import { ConfigProvider, message } from 'antd'\nimport React, { FC } from 'react'\nimport { AuthenticationClient } from 'authing-js-sdk'\n\nimport { GuardContext } from '../../context/global/context'\nimport { GuardScenes } from '../../components/AuthingGuard/types'\nimport { requestClient } from '../../components/AuthingGuard/api/http'\nimport {\n defaultGuardConfig,\n OTP_MFA_CODE,\n APP_MFA_CODE,\n defaultLocalesConfig,\n defaultHeaders,\n} from '../../components/AuthingGuard/constants'\nimport { GuardLayout } from '../../components/AuthingGuard/GuardLayout'\nimport {\n UserConfig,\n GuardEventsHandler,\n} from '../../components/AuthingGuard/types/GuardConfig'\n\nimport './style.less'\nimport { initI18n } from './locales'\nconst PREFIX_CLS = 'authing-ant'\n\nmessage.config({\n prefixCls: `${PREFIX_CLS}-message`,\n})\n\ninterface AuthingGuardProps extends GuardEventsHandler {\n appId: string\n tenantId?: string\n config?: UserConfig\n visible?: boolean\n className?: string\n id?: string\n}\n\nexport const AuthingGuard: FC<AuthingGuardProps> = ({\n appId,\n tenantId,\n config = {},\n visible,\n className,\n id,\n ...guardEvents\n}) => {\n const {\n apiHost,\n appDomain,\n appHost,\n defaultLoginMethod = defaultGuardConfig.defaultLoginMethod,\n defaultScenes = defaultGuardConfig.defaultScenes,\n defaultRegisterMethod = defaultGuardConfig.defaultRegisterMethod,\n lang,\n localesConfig = defaultLocalesConfig,\n headers = defaultHeaders,\n } = config\n\n initI18n(localesConfig, lang)\n\n let realHost: string | undefined\n if (appHost) {\n realHost = appHost\n } else if (appDomain) {\n const parsedUrl = new URL(defaultGuardConfig.appHost!)\n realHost = `${parsedUrl.protocol}//${appDomain}${\n parsedUrl.port ? ':' + parsedUrl.port : ''\n }`\n } else {\n realHost = apiHost || defaultGuardConfig.appHost!\n }\n\n requestClient.setBaseUrl(realHost)\n requestClient.setLangHeader(headers?.lang)\n\n if (tenantId) {\n requestClient.setTenantHeader(headers?.['tenant-id'])\n requestClient.setTenantId(tenantId)\n }\n\n const authClient = new AuthenticationClient({\n appHost: realHost!,\n appId,\n tenantId,\n requestFrom: 'ui-components',\n lang: localesConfig.defaultLang ?? lang,\n headers,\n onError: (code, msg: any) => {\n if (code === 2020) {\n return\n }\n if ([OTP_MFA_CODE, APP_MFA_CODE].includes(code)) {\n message.info(msg)\n return\n }\n message.error(msg)\n },\n })\n\n const activeTabs = {\n [GuardScenes.Login]: defaultLoginMethod,\n [GuardScenes.Register]: defaultRegisterMethod,\n }\n\n return (\n <ConfigProvider prefixCls={PREFIX_CLS}>\n <GuardContext\n value={{\n authClient,\n config: { ...config },\n userConfig: config,\n appId,\n guardScenes: defaultScenes,\n activeTabs,\n guardTitle: config.title,\n mfaData: {\n mfaToken: '',\n },\n guardEvents,\n localesConfig: config.localesConfig,\n realHost: realHost,\n }}\n >\n <GuardLayout\n id={id}\n className={className}\n visible={visible}\n lang={lang}\n userConfig={config}\n />\n </GuardContext>\n </ConfigProvider>\n )\n}\n","import { ReportHandler } from 'web-vitals'\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry)\n getFID(onPerfEntry)\n getFCP(onPerfEntry)\n getLCP(onPerfEntry)\n getTTFB(onPerfEntry)\n })\n }\n}\n\nexport default reportWebVitals\n","import { Button } from 'antd'\nimport React, { useState } from 'react'\nimport ReactDOM from 'react-dom'\nimport { Lang } from './components'\nimport { AuthingGuard } from './components/AuthingGuard'\n\nimport {\n GuardMode,\n // LoginMethods,\n UserConfig,\n // LoginMethods,\n // RegisterMethods,\n // GuardScenes,\n // SocialConnections,\n} from './components/AuthingGuard/types/GuardConfig'\nimport reportWebVitals from './reportWebVitals'\n\nconst App = () => {\n const [lang, setLang] = useState<Lang>('zh-CN')\n const [title, setTitle] = useState('标题')\n\n const config: UserConfig = {\n mode: GuardMode.Modal,\n appHost: 'https://core.dev2.authing-inc.co',\n // apiHost: 'http://console.authing.localhost:3000',\n // apiHost: 'http://192.168.50.57:3000',\n // loginMethods: Object.values(LoginMethods),\n // logo:\n // 'https://files.authing.co/user-contents/photos/0a4c99ff-b8ce-4030-aaaf-584c807cb21c.png',\n // title: 'Authing',\n // defaultLoginMethod: LoginMethods.LDAP,\n // registerMethods: Object.values(RegisterMethods),\n // defaultRegisterMethod: RegisterMethods.Email,\n // defaultScenes: GuardScenes.Login,\n // socialConnections: Object.values(SocialConnections),\n // enterpriseConnections: [\"oidc1\"],\n // appDomain: 'oidc1.authing.cn',\n // appId: '5f17a529f64fb009b794a2ff',\n // isSSO: true,\n // zIndex: 300,\n // text: {\n // loginTabs: {\n // [LoginMethods.Password]: '密码登录一下',\n // },\n // loginBtn: {\n // loading: 'fuck',\n // },\n // },\n // mode: GuardMode.Modal,\n // contentCss: `\n // html, body {\n // background-color: #fff;\n // }\n // `,\n // // autoRegister: true,\n // socialConnections: [SocialConnections.AppleWeb],\n }\n\n const [visible, setVisible] = useState(false)\n\n // useEffect(() => {\n // setTimeout(() => setVisible(true), 3000)\n // }, [])\n\n // initAuthClient({\n // appId: '60c02a89a9e0431e271d9ff0',\n // // appHost: 'http://console.authing.localhost:3000',\n // })\n\n return (\n // eslint-disable-next-line react/jsx-no-undef\n <>\n <Button\n type=\"primary\"\n onClick={() => {\n setVisible(!visible)\n }}\n >\n 开关\n </Button>\n <Button\n type=\"primary\"\n onClick={() => {\n setLang('zh-CN')\n }}\n >\n 中文\n </Button>\n <Button\n type=\"primary\"\n onClick={() => {\n setLang('en-US')\n }}\n >\n English\n </Button>\n <input\n value={title}\n onChange={(evt) => setTitle(evt.target.value)}\n ></input>\n <AuthingGuard\n onLoad={(v) => console.log(v)}\n visible={visible}\n // onLoginTabChange={(v) => console.log(v)}\n // onRegisterTabChange={(v) => console.log(v)}\n // onClose={() => {\n // setVisible(false)\n // setTimeout(() => {\n // setVisible(true)\n // }, 2000)\n // }}\n onClose={() => {\n setVisible(false)\n }}\n // onLoad={(a) => console.log(a, '加载完成')}\n // onPwdResetError={(e) => console.log(e)}\n appId=\"619c7976cd38c13a2222464f\"\n tenantId=\"619c864928b15c6421d12e35\"\n // appId=\"5fd877fb0ba0421962eced94\"\n config={config}\n />\n </>\n )\n}\n\nReactDOM.render(<App />, document.getElementById('root'))\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals()\n","export * from './Forms'\nexport * from './GuardState'\nexport * from './GuardConfig'\nexport * from './Locales'\n","import {\n AuthenticationClient,\n AuthenticationClientOptions,\n CommonMessage,\n SocialConnectionProvider,\n User,\n} from 'authing-js-sdk'\nimport { QrCodeAuthenticationClient } from 'authing-js-sdk/build/main/lib/authentication/QrCodeAuthenticationClient'\n\nimport {\n SocialConnectionItem,\n EnterpriseConnectionItem,\n ApplicationConfig,\n PasswordLoginMethods,\n Agreement,\n} from '../../../components/AuthingGuard/api'\nimport { Lang } from './Locales'\n\nexport type { AuthenticationClient, CommonMessage, User } from 'authing-js-sdk'\n\nexport enum GuardMode {\n Modal = 'modal',\n Normal = 'normal',\n}\n\nexport enum LoginMethods {\n LDAP = 'ldap',\n AppQr = 'app-qrcode',\n Password = 'password',\n PhoneCode = 'phone-code',\n WxMinQr = 'wechat-miniprogram-qrcode', // 对应社会化登录的 wechat:miniprogram:qrconnect(小程序扫码登录)\n AD = 'ad', // 对应企业身份源的 Windows AD 登录\n WechatMpQrcode = 'wechatmp-qrcode', // 微信扫码关注登录\n}\n\nexport enum RegisterMethods {\n Email = 'email',\n Phone = 'phone',\n}\n\nexport enum GuardScenes {\n Login = 'login',\n Register = 'register',\n MfaVerify = 'mfaVerify',\n AppMfaVerify = 'appMfaVerify',\n RestPassword = 'restPassword',\n CompleteUserInfo = 'completeUserInfo',\n}\n\nexport enum ResetPwdMethods {\n Email = 'email',\n Phone = 'phone',\n}\n\nexport enum SocialConnections {\n Qq = 'qq',\n Weibo = 'weibo',\n Github = 'github',\n Google = 'google',\n WxPc = 'wechat:pc',\n Dingtalk = 'dingtalk',\n WxWCorpQr = 'wechatwork:corp:qrconnect',\n WxWSPQr = 'wechatwork:service-provider:qrconnect',\n WxWSPAuth = 'wechatwork:service-provider:authorization',\n AlipayWeb = 'alipay:web',\n AppleWeb = 'apple:web',\n Baidu = 'baidu',\n LarkInternalApp = 'lark-internal',\n LarkMarketPlaceApp = 'lark-public',\n}\n\nexport enum Protocol {\n AD = 'ad',\n CAS = 'cas',\n LDAP = 'ldap',\n OIDC = 'oidc',\n SAML = 'saml',\n OAUTH = 'oauth',\n AZURE_AD = 'azure-ad',\n}\n\n// export enum GuardEventsKebab {\n// // 加载完成,userPool 配置和应用配置(如果有 appId)加载完成\n// Load = 'load',\n// // 加载失败\n// LoadError = 'load-error',\n// // 用户登录成功\n// Login = 'login',\n// // 用户登录失败\n// LoginError = 'login-error',\n// // 注册成功\n// Register = 'register',\n// // 注册失败\n// RegisterError = 'register-error',\n// // 忘记密码邮件发送成功\n// PwdEmailSend = 'pwd-email-send',\n// // 忘记密码邮件发送失败\n// PwdEmailSendError = 'pwd-email-send-error',\n// // 忘记密码手机验证码发送成功\n// PwdPhoneSend = 'pwd-phone-send',\n// // 忘记密码手机验证码发送失败\n// PwdPhoneSendError = 'pwd-phone-send-error',\n// // 重置密码成功\n// PwdReset = 'pwd-reset',\n// // 重置密码失败\n// PwdResetError = 'pwd-reset-error',\n// // 表单关闭事件\n// Close = 'close',\n// }\n\n// export interface GuardEventsCamelCase {\n// // 加载完成,userPool 配置和应用配置(如果有 appId)加载完成\n// [GuardEvents.Load]: 'onLoad'\n// // 加载失败\n// [GuardEvents.LoadError]: 'onLoadError'\n// // 用户登录成功\n// [GuardEvents.Login]: 'onLogin'\n// // 用户登录失败\n// [GuardEvents.LoginError]: 'onLoginError'\n// // 注册成功\n// [GuardEvents.Register]: 'onRegister'\n// // 注册失败\n// [GuardEvents.RegisterError]: 'onRegisterError'\n// // 忘记密码邮件发送成功\n// [GuardEvents.PwdEmailSend]: 'onPwdEmailSend'\n// // 忘记密码邮件发送失败\n// [GuardEvents.PwdEmailSendError]: 'onPwdEmailSendError'\n// // 忘记密码手机验证码发送成功\n// [GuardEvents.PwdPhoneSend]: 'onPwdPhoneSend'\n// // 忘记密码手机验证码发送失败\n// [GuardEvents.PwdPhoneSendError]: 'onPwdPhoneSendError'\n// // 重置密码成功\n// [GuardEvents.PwdReset]: 'onPwdReset'\n// // 重置密码失败\n// [GuardEvents.PwdResetError]: 'onPwdResetError'\n// // 表单关闭事件\n// [GuardEvents.Close]: 'onClose'\n// }\n\n// export enum GuardEvents {\n// // 加载完成,userPool 配置和应用配置(如果有 appId)加载完成\n// Load = 'onLoad',\n// // 加载失败\n// LoadError = 'onLoadError',\n// // 用户登录成功\n// Login = 'onLogin',\n// // 用户登录失败\n// LoginError = 'onLoginError',\n// // 注册成功\n// Register = 'onRegister',\n// // 注册失败\n// RegisterError = 'onRegisterError',\n// // 忘记密码邮件发送成功\n// PwdEmailSend = 'onPwdEmailSend',\n// // 忘记密码邮件发送失败\n// PwdEmailSendError = 'onPwdEmailSendError',\n// // 忘记密码手机验证码发送成功\n// PwdPhoneSend = 'onPwdPhoneSend',\n// // 忘记密码手机验证码发送失败\n// PwdPhoneSendError = 'onPwdPhoneSendError',\n// // 重置密码成功\n// PwdReset = 'onPwdReset',\n// // 重置密码失败\n// PwdResetError = 'onPwdResetError',\n// // 表单关闭事件\n// Close = 'onClose',\n// }\n\nexport const GuardEventsCamelToKebabMap = {\n onLoad: 'load',\n onLoadError: 'load-error',\n onLogin: 'login',\n onBeforeLogin: 'before-login',\n onLoginError: 'login-error',\n onRegister: 'register',\n onBeforeRegister: 'before-register',\n onRegisterError: 'register-error',\n onPwdEmailSend: 'pwd-email-send',\n onPwdEmailSendError: 'pwd-email-send-error',\n onPwdPhoneSend: 'pwd-phone-send',\n onPwdPhoneSendError: 'pwd-phone-send-error',\n onPwdReset: 'pwd-reset',\n onPwdResetError: 'pwd-reset-error',\n onClose: 'close',\n onLoginTabChange: 'login-tab-change',\n onRegisterTabChange: 'register-tab-change',\n onRegisterInfoCompleted: 'register-info-completed',\n onRegisterInfoCompletedError: 'register-info-completed-error',\n} as const\n\nexport interface GuardEventsHandlerKebab {\n // 加载完成,userPool 配置和应用配置(如果有 appId)加载完成\n load: GuardEventsHandler['onLoad']\n // 加载失败\n 'load-error': GuardEventsHandler['onLoadError']\n // 登录前,即表单校验完成,请求接口前\n 'before-login': GuardEventsHandler['onBeforeLogin']\n // 用户登录成功\n login: GuardEventsHandler['onLogin']\n // 用户登录失败\n 'login-error': GuardEventsHandler['onLoginError']\n // 注册前,即表单校验完成,请求接口前\n 'before-register': GuardEventsHandler['onBeforeRegister']\n // 注册成功\n register: GuardEventsHandler['onRegister']\n // 注册失败\n 'register-error': GuardEventsHandler['onRegisterError']\n // 忘记密码邮件发送成功\n 'pwd-email-send': GuardEventsHandler['onPwdEmailSend']\n // 忘记密码邮件发送失败\n 'pwd-email-send-error': GuardEventsHandler['onPwdEmailSendError']\n // 忘记密码手机验证码发送成功\n 'pwd-phone-send': GuardEventsHandler['onPwdPhoneSend']\n // 忘记密码手机验证码发送失败\n 'pwd-phone-send-error': GuardEventsHandler['onPwdPhoneSendError']\n // 重置密码成功\n 'pwd-reset': GuardEventsHandler['onPwdReset']\n // 重置密码失败\n 'pwd-reset-error': GuardEventsHandler['onPwdResetError']\n // 表单关闭事件\n close: GuardEventsHandler['onClose']\n // 登录的 tab 切换\n 'login-tab-change': GuardEventsHandler['onLoginTabChange']\n // 注册的 tab 切换\n 'register-tab-change': GuardEventsHandler['onRegisterTabChange']\n // 注册信息补充完毕\n 'register-info-completed': GuardEventsHandler['onRegisterInfoCompleted']\n // 注册信息补充失败\n 'register-info-completed-error': GuardEventsHandler['onRegisterInfoCompletedError']\n}\n\nexport interface PasswordLoginParams {\n type: LoginMethods.Password\n data: {\n // 标识,可能是用户名、邮箱、手机号\n identity: string\n // 密码\n password: string\n // 图形验证码\n captchaCode?: string\n }\n}\n\nexport interface LDAPLoginParams {\n type: LoginMethods.LDAP\n data: {\n // 标识,可能是用户名、邮箱、手机号\n identity: string\n // 密码\n password: string\n // 图形验证码\n captchaCode?: string\n }\n}\n\nexport interface ADLoginParams {\n type: LoginMethods.AD\n data: {\n // 标识,可能是用户名、邮箱、手机号\n identity: string\n // 密码\n password: string\n }\n}\n\nexport interface PhoneCodeLoginParams {\n type: LoginMethods.PhoneCode\n data: {\n // 手机号\n phone: string\n // 手机验证码\n code: string\n }\n}\n\nexport interface EmailRegisterParams {\n type: RegisterMethods.Email\n data: {\n // 邮箱\n email: string\n // 密码\n password: string\n }\n}\n\nexport interface PhoneRegisterParams {\n type: RegisterMethods.Phone\n data: {\n // 手机号\n phone: string\n // 密码\n password: string\n // 手机验证码\n code: string\n }\n}\n\nexport interface GuardEventsHandler {\n onLoad?: (authClient: AuthenticationClient) => void\n onLoadError?: (error: CommonMessage) => void\n onBeforeLogin?: (\n loginInfo:\n | PasswordLoginParams\n | LDAPLoginParams\n | ADLoginParams\n | PhoneCodeLoginParams,\n authClient: AuthenticationClient\n ) => boolean | Promise<boolean>\n onLogin?: (user: User, authClient: AuthenticationClient) => void\n onLoginError?: (user: User, authClient: AuthenticationClient) => void\n onBeforeRegister?: (\n registerInfo: EmailRegisterParams | PhoneRegisterParams,\n authClient: AuthenticationClient\n ) => boolean | Promise<boolean>\n onRegister?: (user: User, authClient: AuthenticationClient) => void\n onRegisterError?: (user: User, authClient: AuthenticationClient) => void\n onPwdEmailSend?: (authClient: AuthenticationClient) => void\n onPwdEmailSendError?: (\n error: CommonMessage,\n authClient: AuthenticationClient\n ) => void\n onPwdPhoneSend?: (authClient: AuthenticationClient) => void\n onPwdPhoneSendError?: (\n error: CommonMessage,\n authClient: AuthenticationClient\n ) => void\n onPwdReset?: (authClient: AuthenticationClient) => void\n onPwdResetError?: (\n error: CommonMessage,\n authClient: AuthenticationClient\n ) => void\n onClose?: () => void\n onLoginTabChange?: (activeTab: LoginMethods) => void\n onRegisterTabChange?: (activeTab: RegisterMethods) => void\n onRegisterInfoCompleted?: (\n user: User,\n udfs: {\n definition: any\n value: any\n }[],\n authClient: AuthenticationClient\n ) => void\n onRegisterInfoCompletedError?: (\n error: CommonMessage,\n udfs: {\n definition: any\n value: any\n }[],\n authClient: AuthenticationClient\n ) => void\n}\n\nexport interface UserConfig {\n logo?: string\n title?: string\n description?: string\n zIndex?: number\n isSSO?: boolean\n mode?: GuardMode\n /**\n * @deprecated 使用 appHost\n */\n apiHost?: string\n /**\n * @deprecated 使用 appHost\n */\n appDomain?: string\n appHost?: string\n contentCss?: string\n text?: {\n loginBtn?: {\n normal?: string\n loading?: string\n }\n registerBtn?: {\n normal?: string\n loading?: string\n }\n // 登录 tab\n loginTabs?: Partial<Record<LoginMethods, string>>\n }\n escCloseable?: boolean\n autoRegister?: boolean\n clickCloseable?: boolean\n disableResetPwd?: boolean\n disableRegister?: boolean\n defaultScenes?: GuardScenes\n loginMethods?: LoginMethods[]\n target?: string | HTMLElement\n enterpriseConnections?: string[]\n defaultLoginMethod?: LoginMethods\n registerMethods?: RegisterMethods[]\n socialConnections?: (SocialConnections | SocialConnectionProvider)[]\n defaultRegisterMethod?: RegisterMethods\n qrCodeScanOptions?: Parameters<QrCodeAuthenticationClient['startScanning']>[1]\n /**\n * 国际化处理\n */\n localesConfig?: LocalesConfig\n lang?: Lang\n /**\n * 用于去品牌化\n */\n headers?: AuthenticationClientOptions['headers']\n passwordLoginMethods?: PasswordLoginMethods[]\n}\n\nexport interface GuardConfig extends UserConfig {\n socialConnectionObjs: SocialConnectionItem[]\n enterpriseConnectionObjs: EnterpriseConnectionItem[]\n extendsFields: ApplicationConfig['extendsFields']\n publicKey: ApplicationConfig['publicKey']\n agreementEnabled: boolean\n agreements: Agreement[]\n loginMethodTitleMapping: Record<string, string>\n}\n\nexport interface LocalesConfig {\n defaultLang?: Lang\n isShowChange?: boolean\n onChange?: (lang: Lang) => void\n}\n"],"sourceRoot":""}