@authing/react-ui-components 3.1.37-beta.7 → 3.1.38-beta.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.
- package/lib/index.d.ts +8 -626
- package/lib/index.min.css +1 -1
- package/lib/index.min.js +1 -1
- package/lib/index.min.js.LICENSE.txt +0 -9
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1575,329 +1575,6 @@ declare module '@authing/react-ui-components/components/Guard/config' {
|
|
|
1575
1575
|
}
|
|
1576
1576
|
export const getDefaultGuardLocalConfig: () => GuardLocalConfig;
|
|
1577
1577
|
|
|
1578
|
-
}
|
|
1579
|
-
declare module '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts' {
|
|
1580
|
-
/**
|
|
1581
|
-
* 整体的思路:
|
|
1582
|
-
* 在所有登录方式中,当进行登录时保存登录方式(FE侧自定义)
|
|
1583
|
-
* 之后在登录成功(onLogin)中,触发store的方法保存用户信息以及对应的登录方式进入localStorage。
|
|
1584
|
-
* 当用户再次打开页面时,拿出数据进行对比。(主要对比 LoginWay ),TODO: 这里的代码主要显得乱的原因是因为枚举的不正当使用。(主要要和Server端进行互相映射,后续维护时可优化)
|
|
1585
|
-
*
|
|
1586
|
-
* 核心思路:登录成功时,保存的FE侧自定义 LoginWay
|
|
1587
|
-
* 再次打开页面时,初始化时先根据 FE 自定义的 LoginWay 跳转到不同的 tab 下(way)下使用 account 进行回填。TODO: 这里也可优化,应该在登录成功时候就进行 LoginWay 的格式化,而非转来转去。(但是这样无法直观的体现是哪种方式进行登录)
|
|
1588
|
-
*/
|
|
1589
|
-
import { SelectOptions } from '@authing/react-ui-components/components/Login/multipleAccounts/panel';
|
|
1590
|
-
export const QR_CODE_WAY: LoginWay[];
|
|
1591
|
-
/**
|
|
1592
|
-
* 登录时所有支持的登录列表(前端定义列表)
|
|
1593
|
-
* 这里稍微有点乱 因为Login中的登录方式和这里的不匹配,暂时放在了一起
|
|
1594
|
-
*/
|
|
1595
|
-
export type LoginWay = 'email' | 'phone' | 'password' | 'phone-code' | 'email-code' | 'social' | 'wechat-miniprogram-qrcode' | 'wechatmp-qrcode' | 'app-qrcode' | 'ad' | 'ldap' | 'ldap-password' | 'ldap-email' | 'ldap-phone';
|
|
1596
|
-
/**
|
|
1597
|
-
* when: 多账号页面跳转进入登录页面
|
|
1598
|
-
* 携带的回填数据信息
|
|
1599
|
-
*/
|
|
1600
|
-
export interface BackFillMultipleState extends Omit<User, 'id' | 'name' | 'nickname' | 'username' | 'phone' | 'email' | 'photo' | '_updateTime'> {
|
|
1601
|
-
/**
|
|
1602
|
-
* 回填的账号名称 邮箱/用户名/手机
|
|
1603
|
-
*/
|
|
1604
|
-
account: string;
|
|
1605
|
-
}
|
|
1606
|
-
/**
|
|
1607
|
-
* Store instance
|
|
1608
|
-
*/
|
|
1609
|
-
export type StoreInstance = ReturnType<MultipleAccount['getStore']>;
|
|
1610
|
-
/**
|
|
1611
|
-
* 当前 userId 对应的类型
|
|
1612
|
-
*/
|
|
1613
|
-
export interface CurrentStore {
|
|
1614
|
-
[id: string]: User;
|
|
1615
|
-
}
|
|
1616
|
-
export interface User {
|
|
1617
|
-
/**
|
|
1618
|
-
* userId
|
|
1619
|
-
*/
|
|
1620
|
-
id: string;
|
|
1621
|
-
/**
|
|
1622
|
-
* Tab 栏状态
|
|
1623
|
-
*/
|
|
1624
|
-
tab: 'input' | 'qrcode';
|
|
1625
|
-
/**
|
|
1626
|
-
* 登录方式
|
|
1627
|
-
*/
|
|
1628
|
-
way: LoginWay;
|
|
1629
|
-
/**
|
|
1630
|
-
* 姓名
|
|
1631
|
-
*/
|
|
1632
|
-
name?: string | null;
|
|
1633
|
-
/**
|
|
1634
|
-
* 昵称
|
|
1635
|
-
*/
|
|
1636
|
-
nickname?: string | null;
|
|
1637
|
-
/**
|
|
1638
|
-
* 用户名
|
|
1639
|
-
*/
|
|
1640
|
-
username?: string | null;
|
|
1641
|
-
/**
|
|
1642
|
-
* 手机号
|
|
1643
|
-
*/
|
|
1644
|
-
phone?: string | null;
|
|
1645
|
-
/**
|
|
1646
|
-
* 邮箱
|
|
1647
|
-
*/
|
|
1648
|
-
email?: string | null;
|
|
1649
|
-
/**
|
|
1650
|
-
* 头像
|
|
1651
|
-
*/
|
|
1652
|
-
photo?: string | null;
|
|
1653
|
-
/**
|
|
1654
|
-
* qrCodeId 对应的ID
|
|
1655
|
-
*/
|
|
1656
|
-
qrCodeId?: string;
|
|
1657
|
-
/**
|
|
1658
|
-
* 国际化短信区号
|
|
1659
|
-
*/
|
|
1660
|
-
phoneCountryCode?: string;
|
|
1661
|
-
/**
|
|
1662
|
-
* 国际化短信选择框回填
|
|
1663
|
-
*/
|
|
1664
|
-
areaCode?: string;
|
|
1665
|
-
/**
|
|
1666
|
-
* 登录时间
|
|
1667
|
-
*/
|
|
1668
|
-
_updateTime?: string;
|
|
1669
|
-
}
|
|
1670
|
-
class MultipleAccount {
|
|
1671
|
-
/**
|
|
1672
|
-
* 原始的登录账号
|
|
1673
|
-
*/
|
|
1674
|
-
private originAccount;
|
|
1675
|
-
private originWay;
|
|
1676
|
-
/**
|
|
1677
|
-
* 原始的 localStore 值
|
|
1678
|
-
*/
|
|
1679
|
-
private originStore;
|
|
1680
|
-
/**
|
|
1681
|
-
* 当前 AppId Store
|
|
1682
|
-
*/
|
|
1683
|
-
private currentStore;
|
|
1684
|
-
/**
|
|
1685
|
-
* 单账号直接回填
|
|
1686
|
-
*/
|
|
1687
|
-
private firstBackFillData?;
|
|
1688
|
-
/**
|
|
1689
|
-
* server 返回支持的登录方式
|
|
1690
|
-
*/
|
|
1691
|
-
private serverSideLoginMethods;
|
|
1692
|
-
/**
|
|
1693
|
-
* 是否显示多账号登录页面
|
|
1694
|
-
* true 存在
|
|
1695
|
-
*/
|
|
1696
|
-
private memberState;
|
|
1697
|
-
/**
|
|
1698
|
-
* 二维码登录时的ID
|
|
1699
|
-
*/
|
|
1700
|
-
private qrCodeId?;
|
|
1701
|
-
/**
|
|
1702
|
-
* 国际化短信前缀 区号
|
|
1703
|
-
*/
|
|
1704
|
-
private phoneCountryCode?;
|
|
1705
|
-
/**
|
|
1706
|
-
* 国际化短信前缀 选中地区编号
|
|
1707
|
-
*/
|
|
1708
|
-
private areaCode?;
|
|
1709
|
-
private tabStatus?;
|
|
1710
|
-
/**
|
|
1711
|
-
* 当前登录二级状态
|
|
1712
|
-
*/
|
|
1713
|
-
private loginWay?;
|
|
1714
|
-
private appId;
|
|
1715
|
-
/**
|
|
1716
|
-
* 是否开启国际化短信
|
|
1717
|
-
*/
|
|
1718
|
-
private isInternationSms?;
|
|
1719
|
-
constructor();
|
|
1720
|
-
/**
|
|
1721
|
-
* 页面首次加载时初始化 Store
|
|
1722
|
-
* 从 LocalStore 中拿值 放到这里来
|
|
1723
|
-
*/
|
|
1724
|
-
private initStore;
|
|
1725
|
-
/**
|
|
1726
|
-
* 初始化记住账号相关信息
|
|
1727
|
-
* @param normalCount
|
|
1728
|
-
* @returns
|
|
1729
|
-
*/
|
|
1730
|
-
private initMemberState;
|
|
1731
|
-
/**
|
|
1732
|
-
* 获取当前ID下有效账号个数
|
|
1733
|
-
* @returns qrCount 有效的二维码登录个数 normalCount 有效的账号登录方式
|
|
1734
|
-
*/
|
|
1735
|
-
private memberStateCount;
|
|
1736
|
-
/**
|
|
1737
|
-
* 初始化第一次的数据 TODO: 逻辑有点脏 待整理
|
|
1738
|
-
*/
|
|
1739
|
-
private initBackfillData;
|
|
1740
|
-
/**
|
|
1741
|
-
* 根据前端存储的登录方式返回后端映射方式
|
|
1742
|
-
* @param front
|
|
1743
|
-
*/
|
|
1744
|
-
private getServerLoginMethodByFront;
|
|
1745
|
-
/**
|
|
1746
|
-
* 当前 Store DONE
|
|
1747
|
-
*/
|
|
1748
|
-
private getCurrentStore;
|
|
1749
|
-
/**
|
|
1750
|
-
* 国际化短信过滤
|
|
1751
|
-
* true 表示通过 需要保留
|
|
1752
|
-
* false 表示不通过 需要过滤
|
|
1753
|
-
*/
|
|
1754
|
-
private validateInternationSms;
|
|
1755
|
-
/**
|
|
1756
|
-
* 校验有效的登录方式账号
|
|
1757
|
-
* @param user
|
|
1758
|
-
* @param serverSideLoginMethods
|
|
1759
|
-
* @returns
|
|
1760
|
-
*/
|
|
1761
|
-
private validateMethod;
|
|
1762
|
-
/**
|
|
1763
|
-
*
|
|
1764
|
-
* @param tab 一级Tab状态
|
|
1765
|
-
* @param way 二级Tab状态
|
|
1766
|
-
* @param id 二维码登录时 记录对应的二维码 ID
|
|
1767
|
-
*/
|
|
1768
|
-
private setLoginWay;
|
|
1769
|
-
/**
|
|
1770
|
-
* 设置/更新 store 内的用户信息
|
|
1771
|
-
*/
|
|
1772
|
-
private setUserInfo;
|
|
1773
|
-
/**
|
|
1774
|
-
* 持久化保存
|
|
1775
|
-
*/
|
|
1776
|
-
private saveStore;
|
|
1777
|
-
/**
|
|
1778
|
-
* 根据登录的 account 判断本次登录的方式
|
|
1779
|
-
* @param account 登录输入的账号
|
|
1780
|
-
* @param param1 登录成功返回的相关信息 用户名/手机号/邮箱
|
|
1781
|
-
* @returns
|
|
1782
|
-
*/
|
|
1783
|
-
private setLoginWayByHttpData;
|
|
1784
|
-
/**
|
|
1785
|
-
* 根据登录的 account 判断本次LDAP登录方式
|
|
1786
|
-
* @param account 登录输入的账号
|
|
1787
|
-
* @param param1 登录成功返回的相关信息 用户名/手机号/邮箱
|
|
1788
|
-
* @returns
|
|
1789
|
-
*/
|
|
1790
|
-
private setLoginWayByLDAPData;
|
|
1791
|
-
/**
|
|
1792
|
-
* 根据用户 ID 删除 localStorage 中当前用户 ID
|
|
1793
|
-
*/
|
|
1794
|
-
private delUserById;
|
|
1795
|
-
/**
|
|
1796
|
-
* 获得多账号登录页面的所有用户列表
|
|
1797
|
-
* @param excludeWays
|
|
1798
|
-
*/
|
|
1799
|
-
private getMemoUser;
|
|
1800
|
-
/**
|
|
1801
|
-
* 根据 id 获得当前已登录的用户信息
|
|
1802
|
-
* @param userId
|
|
1803
|
-
* @returns User / undefined
|
|
1804
|
-
*/
|
|
1805
|
-
private getMemoSingleUser;
|
|
1806
|
-
/**
|
|
1807
|
-
* 该方法仅仅需要回填账号的登录方式,其他都不计入
|
|
1808
|
-
* 当用户名/手机号/邮箱/AD/LDAP 相同时,根据登录顺序匹配不同的账号
|
|
1809
|
-
* 根据记住的用户登录方式获取对应的登录账户名
|
|
1810
|
-
* @param way
|
|
1811
|
-
* @param user
|
|
1812
|
-
* @returns
|
|
1813
|
-
*/
|
|
1814
|
-
private getAccountByWay;
|
|
1815
|
-
private _mappingUser;
|
|
1816
|
-
/**
|
|
1817
|
-
* 外部暴露方法
|
|
1818
|
-
*/
|
|
1819
|
-
getStore: () => {
|
|
1820
|
-
initStore: (appId: string, options: {
|
|
1821
|
-
serverSideLoginMethods: LoginWay[];
|
|
1822
|
-
isInternationSms: boolean;
|
|
1823
|
-
}) => void;
|
|
1824
|
-
setLoginWay: (tab: 'input' | 'qrcode', way: LoginWay, id?: string | undefined, internation?: {
|
|
1825
|
-
phoneCountryCode: string;
|
|
1826
|
-
areaCode: string;
|
|
1827
|
-
} | undefined) => void;
|
|
1828
|
-
setUserInfo: (user: Pick<User & {
|
|
1829
|
-
id: string;
|
|
1830
|
-
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
1831
|
-
setLoginWayByHttpData: (account: string, data: {
|
|
1832
|
-
username?: string | undefined;
|
|
1833
|
-
phone?: string | undefined;
|
|
1834
|
-
email?: string | undefined;
|
|
1835
|
-
}) => void;
|
|
1836
|
-
setLoginWayByLDAPData: (account: string, data: {
|
|
1837
|
-
name?: string | undefined;
|
|
1838
|
-
phone?: string | undefined;
|
|
1839
|
-
email?: string | undefined;
|
|
1840
|
-
}) => void;
|
|
1841
|
-
getMemoUser: (excludeWays?: LoginWay[]) => SelectOptions[];
|
|
1842
|
-
getMemoSingleUser: (id: string) => {
|
|
1843
|
-
way: LoginWay;
|
|
1844
|
-
account: string;
|
|
1845
|
-
} | undefined;
|
|
1846
|
-
delUserById: (id: string) => string;
|
|
1847
|
-
getMemberState: () => boolean;
|
|
1848
|
-
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
1849
|
-
getOriginAccount: () => string;
|
|
1850
|
-
getOriginWay: () => string;
|
|
1851
|
-
};
|
|
1852
|
-
}
|
|
1853
|
-
/**
|
|
1854
|
-
* MultipleAccounts 相关 Hook
|
|
1855
|
-
* Finally Config 类型过滤
|
|
1856
|
-
*/
|
|
1857
|
-
const useMultipleAccounts: ({ appId, finallyConfig }: {
|
|
1858
|
-
appId?: string | undefined;
|
|
1859
|
-
finallyConfig?: any;
|
|
1860
|
-
}) => {
|
|
1861
|
-
instance: {
|
|
1862
|
-
initStore: (appId: string, options: {
|
|
1863
|
-
serverSideLoginMethods: LoginWay[];
|
|
1864
|
-
isInternationSms: boolean;
|
|
1865
|
-
}) => void;
|
|
1866
|
-
setLoginWay: (tab: 'input' | 'qrcode', way: LoginWay, id?: string | undefined, internation?: {
|
|
1867
|
-
phoneCountryCode: string;
|
|
1868
|
-
areaCode: string;
|
|
1869
|
-
} | undefined) => void;
|
|
1870
|
-
setUserInfo: (user: Pick<User & {
|
|
1871
|
-
id: string;
|
|
1872
|
-
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
1873
|
-
setLoginWayByHttpData: (account: string, data: {
|
|
1874
|
-
username?: string | undefined;
|
|
1875
|
-
phone?: string | undefined;
|
|
1876
|
-
email?: string | undefined;
|
|
1877
|
-
}) => void;
|
|
1878
|
-
setLoginWayByLDAPData: (account: string, data: {
|
|
1879
|
-
name?: string | undefined;
|
|
1880
|
-
phone?: string | undefined;
|
|
1881
|
-
email?: string | undefined;
|
|
1882
|
-
}) => void;
|
|
1883
|
-
getMemoUser: (excludeWays?: LoginWay[]) => SelectOptions[];
|
|
1884
|
-
getMemoSingleUser: (id: string) => {
|
|
1885
|
-
way: LoginWay;
|
|
1886
|
-
account: string;
|
|
1887
|
-
} | undefined;
|
|
1888
|
-
delUserById: (id: string) => string;
|
|
1889
|
-
getMemberState: () => boolean;
|
|
1890
|
-
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
1891
|
-
getOriginAccount: () => string;
|
|
1892
|
-
getOriginWay: () => string;
|
|
1893
|
-
} | undefined;
|
|
1894
|
-
isMultipleAccount: boolean;
|
|
1895
|
-
referMultipleState: (type: 'login' | 'multiple', data?: BackFillMultipleState | undefined) => void;
|
|
1896
|
-
multipleAccountData: BackFillMultipleState | undefined;
|
|
1897
|
-
clearBackFillData: () => void;
|
|
1898
|
-
};
|
|
1899
|
-
export default useMultipleAccounts;
|
|
1900
|
-
|
|
1901
1578
|
}
|
|
1902
1579
|
declare module '@authing/react-ui-components/components/Guard/core/index' {
|
|
1903
1580
|
/// <reference types="react" />
|
|
@@ -1957,39 +1634,7 @@ declare module '@authing/react-ui-components/components/Guard/event' {
|
|
|
1957
1634
|
export interface GuardEvents extends LoginEvents, RegisterEvents, CompleteInfoEvents, ForgetPasswordEvents, IdentityBindingEvents, IdentityBindingAskEvents {
|
|
1958
1635
|
onBeforeChangeModule?: (key: GuardModuleType, initData?: any) => boolean | Promise<boolean>;
|
|
1959
1636
|
}
|
|
1960
|
-
export const guardEventsFilter: (props: any,
|
|
1961
|
-
initStore: (appId: string, options: {
|
|
1962
|
-
serverSideLoginMethods: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[];
|
|
1963
|
-
isInternationSms: boolean;
|
|
1964
|
-
}) => void;
|
|
1965
|
-
setLoginWay: (tab: "input" | "qrcode", way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
|
|
1966
|
-
phoneCountryCode: string;
|
|
1967
|
-
areaCode: string;
|
|
1968
|
-
} | undefined) => void;
|
|
1969
|
-
setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
|
|
1970
|
-
id: string;
|
|
1971
|
-
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
1972
|
-
setLoginWayByHttpData: (account: string, data: {
|
|
1973
|
-
username?: string | undefined;
|
|
1974
|
-
phone?: string | undefined;
|
|
1975
|
-
email?: string | undefined;
|
|
1976
|
-
}) => void;
|
|
1977
|
-
setLoginWayByLDAPData: (account: string, data: {
|
|
1978
|
-
name?: string | undefined;
|
|
1979
|
-
phone?: string | undefined;
|
|
1980
|
-
email?: string | undefined;
|
|
1981
|
-
}) => void;
|
|
1982
|
-
getMemoUser: (excludeWays?: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
|
|
1983
|
-
getMemoSingleUser: (id: string) => {
|
|
1984
|
-
way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay;
|
|
1985
|
-
account: string;
|
|
1986
|
-
} | undefined;
|
|
1987
|
-
delUserById: (id: string) => string;
|
|
1988
|
-
getMemberState: () => boolean;
|
|
1989
|
-
getFirstBackFillData: () => import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").BackFillMultipleState | undefined;
|
|
1990
|
-
getOriginAccount: () => string;
|
|
1991
|
-
getOriginWay: () => string;
|
|
1992
|
-
} | undefined, openEventsMapping?: boolean | undefined) => GuardEvents;
|
|
1637
|
+
export const guardEventsFilter: (props: any, openEventsMapping?: boolean | undefined) => GuardEvents;
|
|
1993
1638
|
export const guardEventsHijacking: (events: GuardEvents, openEventsMapping?: boolean | undefined) => GuardEvents;
|
|
1994
1639
|
export const GuardEventsCamelToKebabMapping: {
|
|
1995
1640
|
readonly onLoad: "load";
|
|
@@ -2281,7 +1926,6 @@ declare module '@authing/react-ui-components/components/Login/codemap' {
|
|
|
2281
1926
|
declare module '@authing/react-ui-components/components/Login/core/withAD' {
|
|
2282
1927
|
/// <reference types="react" />
|
|
2283
1928
|
import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
2284
|
-
import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2285
1929
|
interface LoginWithADProps {
|
|
2286
1930
|
publicKey: string;
|
|
2287
1931
|
autoRegister?: boolean;
|
|
@@ -2289,14 +1933,6 @@ declare module '@authing/react-ui-components/components/Login/core/withAD' {
|
|
|
2289
1933
|
onLoginFailed: any;
|
|
2290
1934
|
onBeforeLogin: any;
|
|
2291
1935
|
agreements: Agreement[];
|
|
2292
|
-
/**
|
|
2293
|
-
* 回填的数据
|
|
2294
|
-
*/
|
|
2295
|
-
backfillData?: BackFillMultipleState;
|
|
2296
|
-
/**
|
|
2297
|
-
* 根据输入的账号 & 返回获得对应的登录方法
|
|
2298
|
-
*/
|
|
2299
|
-
multipleInstance?: StoreInstance;
|
|
2300
1936
|
}
|
|
2301
1937
|
export const LoginWithAD: (props: LoginWithADProps) => JSX.Element;
|
|
2302
1938
|
export {};
|
|
@@ -2304,12 +1940,10 @@ declare module '@authing/react-ui-components/components/Login/core/withAD' {
|
|
|
2304
1940
|
}
|
|
2305
1941
|
declare module '@authing/react-ui-components/components/Login/core/withAppQrcode' {
|
|
2306
1942
|
/// <reference types="react" />
|
|
2307
|
-
import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2308
1943
|
interface LoginWithAppQrcodeProps {
|
|
2309
1944
|
onLoginSuccess: any;
|
|
2310
1945
|
canLoop: boolean;
|
|
2311
1946
|
qrCodeScanOptions: any;
|
|
2312
|
-
multipleInstance?: StoreInstance;
|
|
2313
1947
|
}
|
|
2314
1948
|
export const LoginWithAppQrcode: (props: LoginWithAppQrcodeProps) => JSX.Element;
|
|
2315
1949
|
export {};
|
|
@@ -2318,7 +1952,6 @@ declare module '@authing/react-ui-components/components/Login/core/withAppQrcode
|
|
|
2318
1952
|
declare module '@authing/react-ui-components/components/Login/core/withLDAP' {
|
|
2319
1953
|
/// <reference types="react" />
|
|
2320
1954
|
import { Agreement } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
2321
|
-
import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2322
1955
|
interface LoginWithLDAPProps {
|
|
2323
1956
|
publicKey: string;
|
|
2324
1957
|
autoRegister?: boolean;
|
|
@@ -2327,14 +1960,6 @@ declare module '@authing/react-ui-components/components/Login/core/withLDAP' {
|
|
|
2327
1960
|
onLoginFailed: any;
|
|
2328
1961
|
onBeforeLogin: any;
|
|
2329
1962
|
agreements: Agreement[];
|
|
2330
|
-
/**
|
|
2331
|
-
* 根据输入的账号 & 返回获得对应的登录方法
|
|
2332
|
-
*/
|
|
2333
|
-
multipleInstance?: StoreInstance;
|
|
2334
|
-
/**
|
|
2335
|
-
* 多账号回填的数据
|
|
2336
|
-
*/
|
|
2337
|
-
backfillData?: BackFillMultipleState;
|
|
2338
1963
|
}
|
|
2339
1964
|
export const LoginWithLDAP: (props: LoginWithLDAPProps) => JSX.Element;
|
|
2340
1965
|
export {};
|
|
@@ -2375,7 +2000,6 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
|
|
|
2375
2000
|
import { Agreement, PasswordLoginMethods } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
2376
2001
|
import { LoginMethods } from '@authing/react-ui-components/components/index';
|
|
2377
2002
|
import { AuthingResponse } from '@authing/react-ui-components/components/_utils/http';
|
|
2378
|
-
import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2379
2003
|
interface LoginWithPasswordProps {
|
|
2380
2004
|
publicKey: string;
|
|
2381
2005
|
autoRegister?: boolean;
|
|
@@ -2389,14 +2013,6 @@ declare module '@authing/react-ui-components/components/Login/core/withPassword/
|
|
|
2389
2013
|
loginWay?: LoginMethods;
|
|
2390
2014
|
submitButText?: string;
|
|
2391
2015
|
saveIdentify?: (type: LoginMethods, identity: string) => void;
|
|
2392
|
-
/**
|
|
2393
|
-
* 根据输入的账号 & 返回获得对应的登录方法
|
|
2394
|
-
*/
|
|
2395
|
-
multipleInstance?: StoreInstance;
|
|
2396
|
-
/**
|
|
2397
|
-
* 多账号回填的数据
|
|
2398
|
-
*/
|
|
2399
|
-
backfillData?: BackFillMultipleState;
|
|
2400
2016
|
}
|
|
2401
2017
|
export const LoginWithPassword: (props: LoginWithPasswordProps) => JSX.Element;
|
|
2402
2018
|
export {};
|
|
@@ -2430,10 +2046,6 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
|
|
|
2430
2046
|
import React, { FC } from 'react';
|
|
2431
2047
|
import './styles.less';
|
|
2432
2048
|
export interface VirtualDropdownProps {
|
|
2433
|
-
/**
|
|
2434
|
-
* 回填的国际化区号
|
|
2435
|
-
*/
|
|
2436
|
-
regionCode?: string;
|
|
2437
2049
|
value?: string;
|
|
2438
2050
|
onChange?: (value: string) => void;
|
|
2439
2051
|
style?: React.CSSProperties;
|
|
@@ -2444,8 +2056,7 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
|
|
|
2444
2056
|
declare module '@authing/react-ui-components/components/Login/core/withVerifyCode/index' {
|
|
2445
2057
|
/// <reference types="react" />
|
|
2446
2058
|
import './styles.less';
|
|
2447
|
-
const LoginWithVerifyCode: (props: any) => JSX.Element;
|
|
2448
|
-
export { LoginWithVerifyCode };
|
|
2059
|
+
export const LoginWithVerifyCode: (props: any) => JSX.Element;
|
|
2449
2060
|
|
|
2450
2061
|
}
|
|
2451
2062
|
declare module '@authing/react-ui-components/components/Login/core/withVerifyCode/inputIdentify' {
|
|
@@ -2460,13 +2071,10 @@ declare module '@authing/react-ui-components/components/Login/core/withVerifyCod
|
|
|
2460
2071
|
}
|
|
2461
2072
|
declare module '@authing/react-ui-components/components/Login/core/withWechatMiniQrcode' {
|
|
2462
2073
|
/// <reference types="react" />
|
|
2463
|
-
import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2464
2074
|
interface LoginWithWechatMiniQrcodeProps {
|
|
2465
2075
|
onLoginSuccess: any;
|
|
2466
2076
|
canLoop: boolean;
|
|
2467
2077
|
qrCodeScanOptions: any;
|
|
2468
|
-
id: string;
|
|
2469
|
-
multipleInstance?: StoreInstance;
|
|
2470
2078
|
}
|
|
2471
2079
|
export const LoginWithWechatMiniQrcode: (props: LoginWithWechatMiniQrcodeProps) => JSX.Element;
|
|
2472
2080
|
export {};
|
|
@@ -2474,85 +2082,14 @@ declare module '@authing/react-ui-components/components/Login/core/withWechatMin
|
|
|
2474
2082
|
}
|
|
2475
2083
|
declare module '@authing/react-ui-components/components/Login/core/withWechatmpQrcode' {
|
|
2476
2084
|
/// <reference types="react" />
|
|
2477
|
-
import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2478
2085
|
interface LoginWithWechatmpQrcodeProps {
|
|
2479
2086
|
onLoginSuccess: any;
|
|
2480
2087
|
canLoop: boolean;
|
|
2481
2088
|
qrCodeScanOptions: any;
|
|
2482
|
-
id: string;
|
|
2483
|
-
/**
|
|
2484
|
-
* 多账号存储实例
|
|
2485
|
-
*/
|
|
2486
|
-
multipleInstance?: StoreInstance;
|
|
2487
2089
|
}
|
|
2488
2090
|
export const LoginWithWechatmpQrcode: (props: LoginWithWechatmpQrcodeProps) => JSX.Element;
|
|
2489
2091
|
export {};
|
|
2490
2092
|
|
|
2491
|
-
}
|
|
2492
|
-
declare module '@authing/react-ui-components/components/Login/hooks/useLoginMultiple' {
|
|
2493
|
-
/// <reference types="react" />
|
|
2494
|
-
import { FormInstance } from 'antd/lib/form';
|
|
2495
|
-
import { BackFillMultipleState, LoginWay } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2496
|
-
/**
|
|
2497
|
-
* 多账号登录下 账户 & 登录方式自动回填
|
|
2498
|
-
* TODO: HOOK 参数有时间整理成为对象,开始没有想到有这么多
|
|
2499
|
-
* 调用地方 core 中需要回填的两个登录方式
|
|
2500
|
-
*/
|
|
2501
|
-
function useLoginMultipleBackFill(options: {
|
|
2502
|
-
form: FormInstance<any>;
|
|
2503
|
-
way: LoginWay;
|
|
2504
|
-
formKey: string;
|
|
2505
|
-
backfillData?: BackFillMultipleState;
|
|
2506
|
-
isOnlyInternationSms?: boolean;
|
|
2507
|
-
setAreaCode?: React.Dispatch<React.SetStateAction<string>>;
|
|
2508
|
-
cancelBackfill?: boolean;
|
|
2509
|
-
}): void;
|
|
2510
|
-
/**
|
|
2511
|
-
* 多账号统一状态管理
|
|
2512
|
-
* @param setLoginWay
|
|
2513
|
-
* @returns
|
|
2514
|
-
*/
|
|
2515
|
-
function useLoginMultiple(setLoginWay: React.Dispatch<any>): {
|
|
2516
|
-
isMultipleAccount: boolean;
|
|
2517
|
-
multipleInstance: {
|
|
2518
|
-
initStore: (appId: string, options: {
|
|
2519
|
-
serverSideLoginMethods: LoginWay[];
|
|
2520
|
-
isInternationSms: boolean;
|
|
2521
|
-
}) => void;
|
|
2522
|
-
setLoginWay: (tab: "input" | "qrcode", way: LoginWay, id?: string | undefined, internation?: {
|
|
2523
|
-
phoneCountryCode: string;
|
|
2524
|
-
areaCode: string;
|
|
2525
|
-
} | undefined) => void;
|
|
2526
|
-
setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
|
|
2527
|
-
id: string;
|
|
2528
|
-
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
2529
|
-
setLoginWayByHttpData: (account: string, data: {
|
|
2530
|
-
username?: string | undefined;
|
|
2531
|
-
phone?: string | undefined;
|
|
2532
|
-
email?: string | undefined;
|
|
2533
|
-
}) => void;
|
|
2534
|
-
setLoginWayByLDAPData: (account: string, data: {
|
|
2535
|
-
name?: string | undefined;
|
|
2536
|
-
phone?: string | undefined;
|
|
2537
|
-
email?: string | undefined;
|
|
2538
|
-
}) => void;
|
|
2539
|
-
getMemoUser: (excludeWays?: LoginWay[]) => import("@authing/react-ui-components/components/Login/multipleAccounts/panel").SelectOptions[];
|
|
2540
|
-
getMemoSingleUser: (id: string) => {
|
|
2541
|
-
way: LoginWay;
|
|
2542
|
-
account: string;
|
|
2543
|
-
} | undefined;
|
|
2544
|
-
delUserById: (id: string) => string;
|
|
2545
|
-
getMemberState: () => boolean;
|
|
2546
|
-
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
2547
|
-
getOriginAccount: () => string;
|
|
2548
|
-
getOriginWay: () => string;
|
|
2549
|
-
} | undefined;
|
|
2550
|
-
referMultipleState: ((type: "login" | "multiple") => void) | undefined;
|
|
2551
|
-
backfillData: BackFillMultipleState | undefined;
|
|
2552
|
-
defaultQrWay: string | undefined;
|
|
2553
|
-
};
|
|
2554
|
-
export { useLoginMultipleBackFill, useLoginMultiple };
|
|
2555
|
-
|
|
2556
2093
|
}
|
|
2557
2094
|
declare module '@authing/react-ui-components/components/Login/index' {
|
|
2558
2095
|
/// <reference types="react" />
|
|
@@ -2601,79 +2138,6 @@ declare module '@authing/react-ui-components/components/Login/interface' {
|
|
|
2601
2138
|
}
|
|
2602
2139
|
export const getDefaultLoginConfig: () => LoginConfig;
|
|
2603
2140
|
|
|
2604
|
-
}
|
|
2605
|
-
declare module '@authing/react-ui-components/components/Login/multipleAccounts/index' {
|
|
2606
|
-
import React from 'react';
|
|
2607
|
-
import { LoginWay, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2608
|
-
import { GuardModuleType } from '@authing/react-ui-components/components/Guard/index';
|
|
2609
|
-
interface MultipleAccountsProps {
|
|
2610
|
-
/**
|
|
2611
|
-
* 多账号存储实例
|
|
2612
|
-
*/
|
|
2613
|
-
multipleInstance?: StoreInstance;
|
|
2614
|
-
/**
|
|
2615
|
-
* 切换 Guard 方法
|
|
2616
|
-
*/
|
|
2617
|
-
changeModule?: (moduleName: GuardModuleType, initData?: any) => Promise<void>;
|
|
2618
|
-
/**
|
|
2619
|
-
* 切换多账号状态
|
|
2620
|
-
*/
|
|
2621
|
-
referMultipleState?: (type: 'login' | 'multiple', data?: {
|
|
2622
|
-
account: string;
|
|
2623
|
-
way: LoginWay;
|
|
2624
|
-
}) => void;
|
|
2625
|
-
}
|
|
2626
|
-
const MultipleAccounts: React.NamedExoticComponent<MultipleAccountsProps>;
|
|
2627
|
-
export { MultipleAccounts };
|
|
2628
|
-
|
|
2629
|
-
}
|
|
2630
|
-
declare module '@authing/react-ui-components/components/Login/multipleAccounts/panel' {
|
|
2631
|
-
import React from 'react';
|
|
2632
|
-
import './style.less';
|
|
2633
|
-
interface SelectPanelProps {
|
|
2634
|
-
lists: SelectOptions[];
|
|
2635
|
-
/**
|
|
2636
|
-
* 点击删除
|
|
2637
|
-
*/
|
|
2638
|
-
handleDel: (id: string) => void;
|
|
2639
|
-
/**
|
|
2640
|
-
* 点击 li
|
|
2641
|
-
*/
|
|
2642
|
-
onClick: (id: string) => void;
|
|
2643
|
-
}
|
|
2644
|
-
export interface SelectOptions {
|
|
2645
|
-
/**
|
|
2646
|
-
* 头像
|
|
2647
|
-
*/
|
|
2648
|
-
photo?: string;
|
|
2649
|
-
/**
|
|
2650
|
-
* 标题
|
|
2651
|
-
*/
|
|
2652
|
-
title?: string;
|
|
2653
|
-
/**
|
|
2654
|
-
* 描述
|
|
2655
|
-
*/
|
|
2656
|
-
description?: string;
|
|
2657
|
-
/**
|
|
2658
|
-
* 用户 ID 唯一标识符
|
|
2659
|
-
*/
|
|
2660
|
-
id: string | 'other';
|
|
2661
|
-
/**
|
|
2662
|
-
* 显示操作栏 default: true
|
|
2663
|
-
*/
|
|
2664
|
-
operation?: boolean;
|
|
2665
|
-
/**
|
|
2666
|
-
* 登录时间
|
|
2667
|
-
*/
|
|
2668
|
-
_updateTime: number;
|
|
2669
|
-
/**
|
|
2670
|
-
* 替代图片元素
|
|
2671
|
-
*/
|
|
2672
|
-
element?: React.ReactElement;
|
|
2673
|
-
}
|
|
2674
|
-
const SelectPanel: React.FC<SelectPanelProps>;
|
|
2675
|
-
export { SelectPanel };
|
|
2676
|
-
|
|
2677
2141
|
}
|
|
2678
2142
|
declare module '@authing/react-ui-components/components/Login/socialLogin/IdpButton/index' {
|
|
2679
2143
|
/// <reference types="react" />
|
|
@@ -2685,7 +2149,6 @@ declare module '@authing/react-ui-components/components/Login/socialLogin/index'
|
|
|
2685
2149
|
import { ApplicationConfig, SocialConnectionItem } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
2686
2150
|
import './style.less';
|
|
2687
2151
|
import { GuardLocalConfig } from '@authing/react-ui-components/components/Guard/index';
|
|
2688
|
-
import { StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
2689
2152
|
export interface SocialLoginProps {
|
|
2690
2153
|
appId: string;
|
|
2691
2154
|
config: GuardLocalConfig;
|
|
@@ -2693,10 +2156,6 @@ declare module '@authing/react-ui-components/components/Login/socialLogin/index'
|
|
|
2693
2156
|
onLoginSuccess: any;
|
|
2694
2157
|
enterpriseConnectionObjs: ApplicationConfig['identityProviders'];
|
|
2695
2158
|
socialConnectionObjs: SocialConnectionItem[];
|
|
2696
|
-
/**
|
|
2697
|
-
* 根据输入的账号 & 返回获得对应的登录方法
|
|
2698
|
-
*/
|
|
2699
|
-
multipleInstance?: StoreInstance;
|
|
2700
2159
|
}
|
|
2701
2160
|
export const SocialLogin: React.FC<SocialLoginProps>;
|
|
2702
2161
|
|
|
@@ -3050,6 +2509,11 @@ declare module '@authing/react-ui-components/components/Register/core/WithCode'
|
|
|
3050
2509
|
registeContext?: any;
|
|
3051
2510
|
methods: any[];
|
|
3052
2511
|
}
|
|
2512
|
+
/**
|
|
2513
|
+
* 手机 Code 注册
|
|
2514
|
+
* @param param0
|
|
2515
|
+
* @returns
|
|
2516
|
+
*/
|
|
3053
2517
|
export const RegisterWithCode: React.FC<RegisterWithCodeProps>;
|
|
3054
2518
|
|
|
3055
2519
|
}
|
|
@@ -3562,7 +3026,6 @@ declare module '@authing/react-ui-components/components/_utils/context' {
|
|
|
3562
3026
|
import React from 'react';
|
|
3563
3027
|
import { GuardEvents, GuardLocalConfig, GuardModuleType, GuardPageConfig } from '@authing/react-ui-components/components/index';
|
|
3564
3028
|
import { ApplicationConfig } from '@authing/react-ui-components/components/AuthingGuard/api/index';
|
|
3565
|
-
import { BackFillMultipleState, StoreInstance } from '@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts';
|
|
3566
3029
|
import { ModuleState } from '@authing/react-ui-components/components/Guard/GuardModule/stateMachine';
|
|
3567
3030
|
import { GuardHttp } from '@authing/react-ui-components/components/_utils/guardHttp';
|
|
3568
3031
|
export interface IGuardContext {
|
|
@@ -3580,29 +3043,6 @@ declare module '@authing/react-ui-components/components/_utils/context' {
|
|
|
3580
3043
|
isAuthFlow: boolean;
|
|
3581
3044
|
contextLoaded: boolean;
|
|
3582
3045
|
guardPageConfig: Partial<GuardPageConfig>;
|
|
3583
|
-
multipleInstance: {
|
|
3584
|
-
/**
|
|
3585
|
-
* 多账号相关
|
|
3586
|
-
*/
|
|
3587
|
-
isMultipleAccount: boolean;
|
|
3588
|
-
/**
|
|
3589
|
-
* when: 多账号页面跳转进入登录页面
|
|
3590
|
-
* 携带的回填数据信息
|
|
3591
|
-
*/
|
|
3592
|
-
multipleAccountData?: BackFillMultipleState;
|
|
3593
|
-
/**
|
|
3594
|
-
* 多账号 store 实例
|
|
3595
|
-
*/
|
|
3596
|
-
instance?: StoreInstance;
|
|
3597
|
-
/**
|
|
3598
|
-
* 切换多账号 isMultipleAccount 状态
|
|
3599
|
-
*/
|
|
3600
|
-
referMultipleState?: (type: 'login' | 'multiple') => void;
|
|
3601
|
-
/**
|
|
3602
|
-
* 清空回填数据
|
|
3603
|
-
*/
|
|
3604
|
-
clearBackFillData?: () => void;
|
|
3605
|
-
};
|
|
3606
3046
|
}
|
|
3607
3047
|
export const createGuardXContext: () => {
|
|
3608
3048
|
Provider: React.FC<{
|
|
@@ -3640,64 +3080,6 @@ declare module '@authing/react-ui-components/components/_utils/context' {
|
|
|
3640
3080
|
export const useGuardContextLoaded: () => boolean;
|
|
3641
3081
|
export const useGuardIsAuthFlow: () => boolean;
|
|
3642
3082
|
export const useGuardPageConfig: () => Partial<GuardPageConfig>;
|
|
3643
|
-
/**
|
|
3644
|
-
* 多账号登录 store 实例
|
|
3645
|
-
*/
|
|
3646
|
-
export const useGuardMultipleInstance: () => {
|
|
3647
|
-
/**
|
|
3648
|
-
* 多账号相关
|
|
3649
|
-
*/
|
|
3650
|
-
isMultipleAccount: boolean;
|
|
3651
|
-
/**
|
|
3652
|
-
* when: 多账号页面跳转进入登录页面
|
|
3653
|
-
* 携带的回填数据信息
|
|
3654
|
-
*/
|
|
3655
|
-
multipleAccountData?: BackFillMultipleState | undefined;
|
|
3656
|
-
/**
|
|
3657
|
-
* 多账号 store 实例
|
|
3658
|
-
*/
|
|
3659
|
-
instance?: {
|
|
3660
|
-
initStore: (appId: string, options: {
|
|
3661
|
-
serverSideLoginMethods: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[];
|
|
3662
|
-
isInternationSms: boolean;
|
|
3663
|
-
}) => void;
|
|
3664
|
-
setLoginWay: (tab: "input" | "qrcode", way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
|
|
3665
|
-
phoneCountryCode: string;
|
|
3666
|
-
areaCode: string;
|
|
3667
|
-
} | undefined) => void;
|
|
3668
|
-
setUserInfo: (user: Pick<import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").User & {
|
|
3669
|
-
id: string;
|
|
3670
|
-
}, "email" | "username" | "phone" | "id" | "nickname" | "photo" | "name" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
|
|
3671
|
-
setLoginWayByHttpData: (account: string, data: {
|
|
3672
|
-
username?: string | undefined;
|
|
3673
|
-
phone?: string | undefined;
|
|
3674
|
-
email?: string | undefined;
|
|
3675
|
-
}) => void;
|
|
3676
|
-
setLoginWayByLDAPData: (account: string, data: {
|
|
3677
|
-
name?: string | undefined;
|
|
3678
|
-
phone?: string | undefined;
|
|
3679
|
-
email?: string | undefined;
|
|
3680
|
-
}) => void;
|
|
3681
|
-
getMemoUser: (excludeWays?: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
|
|
3682
|
-
getMemoSingleUser: (id: string) => {
|
|
3683
|
-
way: import("@authing/react-ui-components/components/Guard/core/hooks/useMultipleAccounts").LoginWay;
|
|
3684
|
-
account: string;
|
|
3685
|
-
} | undefined;
|
|
3686
|
-
delUserById: (id: string) => string;
|
|
3687
|
-
getMemberState: () => boolean;
|
|
3688
|
-
getFirstBackFillData: () => BackFillMultipleState | undefined;
|
|
3689
|
-
getOriginAccount: () => string;
|
|
3690
|
-
getOriginWay: () => string;
|
|
3691
|
-
} | undefined;
|
|
3692
|
-
/**
|
|
3693
|
-
* 切换多账号 isMultipleAccount 状态
|
|
3694
|
-
*/
|
|
3695
|
-
referMultipleState?: ((type: 'login' | 'multiple') => void) | undefined;
|
|
3696
|
-
/**
|
|
3697
|
-
* 清空回填数据
|
|
3698
|
-
*/
|
|
3699
|
-
clearBackFillData?: (() => void) | undefined;
|
|
3700
|
-
};
|
|
3701
3083
|
|
|
3702
3084
|
}
|
|
3703
3085
|
declare module '@authing/react-ui-components/components/_utils/corsVerification' {
|
|
@@ -4166,7 +3548,7 @@ declare module '@authing/react-ui-components/components/version/index' {
|
|
|
4166
3548
|
|
|
4167
3549
|
}
|
|
4168
3550
|
declare module '@authing/react-ui-components/components/version/version' {
|
|
4169
|
-
const _default: "3.1.
|
|
3551
|
+
const _default: "3.1.38-beta.0";
|
|
4170
3552
|
export default _default;
|
|
4171
3553
|
|
|
4172
3554
|
}
|