@springmicro/auth 0.5.1 → 0.5.3

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.
Files changed (143) hide show
  1. package/.eslintrc.cjs +18 -18
  2. package/README.md +60 -60
  3. package/dist/{Index-64ac63ff-Bb7oVTBw.js → Index-64ac63ff-CSMaEBDA.js} +1 -1
  4. package/dist/{Index-6c094240-Cre9O000.js → Index-6c094240-mSgidTC1.js} +1 -1
  5. package/dist/{Web3Auth-D-jzK5S2.js → Web3Auth-R27O2eCc.js} +10 -10
  6. package/dist/alphawallet-B7eovdf-.js +0 -0
  7. package/dist/apexwallet-ysP20G9D.js +0 -0
  8. package/dist/atoken-BBnNTzcz.js +0 -0
  9. package/dist/bifrostwallet-CNNBO92h.js +0 -0
  10. package/dist/binance-DvPgAzCw.js +0 -0
  11. package/dist/bitget-DZOUrwgy.js +0 -0
  12. package/dist/bitpie-C_uxmEzw.js +0 -0
  13. package/dist/bitski-DpzkHNkv.js +0 -0
  14. package/dist/blockwallet-BL69cqkA.js +0 -0
  15. package/dist/brave-DnRzMQYW.js +0 -0
  16. package/dist/ccip-c78d2f16-DLcRlwod.js +0 -0
  17. package/dist/coin98wallet-CkFdOvXt.js +0 -0
  18. package/dist/coinbase-CaGNx5if.js +0 -0
  19. package/dist/core-9rK8tWud.js +0 -0
  20. package/dist/defiwallet-0AsgJBSy.js +0 -0
  21. package/dist/detected-CX_JZaUk.js +0 -0
  22. package/dist/echooo-CmaetT_Z.js +0 -0
  23. package/dist/enkrypt-BibtwvK7.js +0 -0
  24. package/dist/exodus-BxzkDWWP.js +0 -0
  25. package/dist/fordefi-CvKyVwhI.js +0 -0
  26. package/dist/foxwallet-D7c_LDTf.js +0 -0
  27. package/dist/frame-CDfNmjUy.js +0 -0
  28. package/dist/frontier-DqKNSj2z.js +0 -0
  29. package/dist/{hashMessage-1XTFjS64.js → hashMessage-B7KFzddV.js} +1 -1
  30. package/dist/huobiwallet-CxSwqa5L.js +0 -0
  31. package/dist/hyperpay-nmHE3WqM.js +0 -0
  32. package/dist/icon-2Zqy7pqQ.js +0 -0
  33. package/dist/icon-CGWI1Ies.js +0 -0
  34. package/dist/icon-C_O4nprO.js +0 -0
  35. package/dist/icon-DbgmZCnU.js +0 -0
  36. package/dist/icon-Dbjb6jc5.js +0 -0
  37. package/dist/icon-cAd7RhSC.js +0 -0
  38. package/dist/imtoken-yENtOTS3.js +0 -0
  39. package/dist/index-021f6a62-Zz543EDB.js +0 -0
  40. package/dist/{index-BcBHeHDh.js → index-1HLXgKdW.js} +2 -2
  41. package/dist/index-40a497ea-Bn2mC0r7.js +0 -0
  42. package/dist/{index-Bt-ptciq.js → index-C8xLRoDS.js} +1 -1
  43. package/dist/{index-Dd6Cx4jI.js → index-ChYsa81u.js} +2 -2
  44. package/dist/{index-Bi-yyFKX.js → index-Cp0Pai1C.js} +1 -1
  45. package/dist/{index-BCIsepdu.js → index-D_yyUC2r.js} +1060 -1025
  46. package/dist/{index-m_M0OdCv.js → index-TsElTuix.js} +1 -1
  47. package/dist/{index-D23L6orl.js → index-ayOaYQgv.js} +4 -4
  48. package/dist/index.d.ts +8 -3
  49. package/dist/index.js +1 -1
  50. package/dist/index.umd.cjs +165 -165
  51. package/dist/infinitywallet-C8J4FUYw.js +0 -0
  52. package/dist/kayros-AIrUK1za.js +0 -0
  53. package/dist/keplr-CyLTca9B.js +0 -0
  54. package/dist/lif3wallet-C5D6r8pg.js +0 -0
  55. package/dist/liquality-nbCtErVq.js +0 -0
  56. package/dist/mathwallet-CWkivCXo.js +0 -0
  57. package/dist/meetone-kKmvI8md.js +0 -0
  58. package/dist/metamask-BN7yiDV1.js +0 -0
  59. package/dist/mykey-CQZ6UcLH.js +0 -0
  60. package/dist/native-FDN9oNjc.js +0 -0
  61. package/dist/{number-DcOvM-ZJ.js → number-D9Q-3_Cz.js} +1 -1
  62. package/dist/okxwallet-CJLVogh2.js +0 -0
  63. package/dist/oneInch-CciyZ4Pz.js +0 -0
  64. package/dist/onekey-Dal8kYjU.js +0 -0
  65. package/dist/opera-DnKg-TJU.js +0 -0
  66. package/dist/ownbit-BshJUVuW.js +0 -0
  67. package/dist/phantom-CJ8dIcov.js +0 -0
  68. package/dist/rabby-D4thTcd6.js +0 -0
  69. package/dist/rainbow-mXld6yWV.js +0 -0
  70. package/dist/roninwallet-ZyYrd-D1.js +0 -0
  71. package/dist/safeheron-Eg1Jb29V.js +0 -0
  72. package/dist/safepal-DVIKy94N.js +0 -0
  73. package/dist/sequence-BS2IbtDg.js +0 -0
  74. package/dist/stablewallet-jyB079Wb.js +0 -0
  75. package/dist/status-FrAvQjfn.js +0 -0
  76. package/dist/subwallet-DMvFqKyY.js +0 -0
  77. package/dist/talisman-Bp8zUXqB.js +0 -0
  78. package/dist/tallywallet-B4OS9nIr.js +0 -0
  79. package/dist/tokenary-C7jjcbQa.js +0 -0
  80. package/dist/tokenpocket-9ZRPmAFA.js +0 -0
  81. package/dist/tp-V2em5bdl.js +0 -0
  82. package/dist/transactionRequest-be6a8ea9-CUKWo5mx.js +0 -0
  83. package/dist/trust-SgHubMq7.js +0 -0
  84. package/dist/xdefi-COVIyGz4.js +0 -0
  85. package/dist/zeal-DxHbDqm0.js +0 -0
  86. package/dist/zerion-BfW0UElc.js +0 -0
  87. package/dist/zodiacpilot-CrId6F4w.js +0 -0
  88. package/index.html +13 -13
  89. package/package.json +2 -2
  90. package/src/auth/config.ts +91 -91
  91. package/src/components/SignUp.tsx +472 -442
  92. package/src/components/forms/AgreementModal.tsx +88 -88
  93. package/src/components/forms/CaptchaController.tsx +94 -94
  94. package/src/components/forms/CaptchaModal.jsx +171 -171
  95. package/src/components/forms/CaptchaWidget.jsx +146 -146
  96. package/src/components/forms/PasswordChecker.ts +88 -88
  97. package/src/components/forms/SendCodeInput.tsx +155 -149
  98. package/src/components/forms/SignUpFormItem.tsx +708 -704
  99. package/src/components/forms/util/application-api.ts +161 -157
  100. package/src/components/forms/util/auth-api.ts +198 -198
  101. package/src/components/forms/util/auth-util.tsx +346 -346
  102. package/src/components/forms/util/core.ts +493 -493
  103. package/src/components/forms/util/invitation-api.ts +132 -132
  104. package/src/components/forms/util/provider.tsx +603 -603
  105. package/src/components/forms/util/user-api.ts +311 -307
  106. package/src/components/provider/AdfsLoginButton.jsx +38 -38
  107. package/src/components/provider/AlipayLoginButton.jsx +38 -38
  108. package/src/components/provider/AppleLoginButton.jsx +38 -38
  109. package/src/components/provider/AzureADB2CLoginButton.jsx +38 -38
  110. package/src/components/provider/AzureADLoginButton.jsx +38 -38
  111. package/src/components/provider/BaiduLoginButton.jsx +38 -38
  112. package/src/components/provider/BilibiliLoginButton.jsx +37 -37
  113. package/src/components/provider/CasdoorLoginButton.jsx +38 -38
  114. package/src/components/provider/DingTalkLoginButton.jsx +37 -37
  115. package/src/components/provider/DouyinLoginButton.jsx +38 -38
  116. package/src/components/provider/FacebookLoginButton.jsx +37 -37
  117. package/src/components/provider/GitHubLoginButton.jsx +37 -37
  118. package/src/components/provider/GitLabLoginButton.jsx +38 -38
  119. package/src/components/provider/GiteeLoginButton.jsx +34 -34
  120. package/src/components/provider/GoogleLoginButton.jsx +68 -68
  121. package/src/components/provider/InfoflowLoginButton.jsx +38 -38
  122. package/src/components/provider/LarkLoginButton.jsx +38 -38
  123. package/src/components/provider/LinkedInLoginButton.jsx +37 -37
  124. package/src/components/provider/LoginButton.jsx +33 -33
  125. package/src/components/provider/OktaLoginButton.jsx +38 -38
  126. package/src/components/provider/Provider.jsx +3 -3
  127. package/src/components/provider/ProviderButton.jsx +327 -327
  128. package/src/components/provider/QqLoginButton.jsx +31 -31
  129. package/src/components/provider/SelfLoginButton.jsx +47 -47
  130. package/src/components/provider/SlackLoginButton.jsx +38 -38
  131. package/src/components/provider/SteamLoginButton.jsx +38 -38
  132. package/src/components/provider/WeComLoginButton.jsx +34 -34
  133. package/src/components/provider/Web3Auth.jsx +365 -365
  134. package/src/components/provider/WechatLoginButton.jsx +37 -37
  135. package/src/components/provider/WeiboLoginButton.jsx +34 -34
  136. package/src/components/util.tsx +174 -170
  137. package/src/i18n/en/signup.json +48 -48
  138. package/src/i18n/index.ts +17 -17
  139. package/src/index.tsx +8 -8
  140. package/src/vite-env.d.ts +1 -1
  141. package/tsconfig.json +23 -23
  142. package/tsconfig.node.json +10 -10
  143. package/vite.config.ts +33 -33
@@ -1,157 +1,161 @@
1
- // https://github.com/casdoor/casdoor/blob/master/web/src/backend/ApplicationBackend.js
2
-
3
- // Copyright 2021 The Casdoor Authors. All Rights Reserved.
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License");
6
- // you may not use this file except in compliance with the License.
7
- // You may obtain a copy of the License at
8
- //
9
- // http://www.apache.org/licenses/LICENSE-2.0
10
- //
11
- // Unless required by applicable law or agreed to in writing, software
12
- // distributed under the License is distributed on an "AS IS" BASIS,
13
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- // See the License for the specific language governing permissions and
15
- // limitations under the License.
16
-
17
- import * as Setting from "./core";
18
-
19
- export function getApplications(
20
- owner: string,
21
- page = "",
22
- pageSize = "",
23
- field = "",
24
- value = "",
25
- sortField = "",
26
- sortOrder = ""
27
- ) {
28
- return fetch(
29
- `${Setting.ROOT_URLS.casdoor}/api/get-applications?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`,
30
- {
31
- method: "GET",
32
- credentials: "include",
33
- headers: {
34
- "Accept-Language": Setting.getAcceptLanguage(),
35
- },
36
- }
37
- ).then((res) => res.json());
38
- }
39
-
40
- export function getApplicationsByOrganization(
41
- owner: string,
42
- organization: string,
43
- page = "",
44
- pageSize = "",
45
- field = "",
46
- value = "",
47
- sortField = "",
48
- sortOrder = ""
49
- ) {
50
- return fetch(
51
- `${Setting.ROOT_URLS.casdoor}/api/get-organization-applications?owner=${owner}&organization=${organization}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`,
52
- {
53
- method: "GET",
54
- credentials: "include",
55
- headers: {
56
- "Accept-Language": Setting.getAcceptLanguage(),
57
- },
58
- }
59
- ).then((res) => res.json());
60
- }
61
-
62
- export function getApplication(owner: string, name: string) {
63
- return fetch(
64
- `${
65
- Setting.ROOT_URLS.casdoor
66
- }/api/get-application?id=${owner}/${encodeURIComponent(name)}`,
67
- {
68
- method: "GET",
69
- credentials: Setting.ROOT_URLS.casdoor.startsWith("https")
70
- ? "include"
71
- : undefined,
72
- headers: {
73
- "Accept-Language": Setting.getAcceptLanguage(),
74
- },
75
- }
76
- ).then((res) => res.json());
77
- }
78
-
79
- export function getUserApplication(owner: string, name: string) {
80
- return fetch(
81
- `${
82
- Setting.ROOT_URLS.casdoor
83
- }/api/get-user-application?id=${owner}/${encodeURIComponent(name)}`,
84
- {
85
- method: "GET",
86
- credentials: "include",
87
- headers: {
88
- "Accept-Language": Setting.getAcceptLanguage(),
89
- },
90
- }
91
- ).then((res) => res.json());
92
- }
93
-
94
- export function updateApplication(
95
- owner: string,
96
- name: string,
97
- application: string
98
- ) {
99
- return fetch(
100
- `${
101
- Setting.ROOT_URLS.casdoor
102
- }/api/update-application?id=${owner}/${encodeURIComponent(name)}`,
103
- {
104
- method: "POST",
105
- credentials: "include",
106
- body: JSON.stringify(application),
107
- headers: {
108
- "Accept-Language": Setting.getAcceptLanguage(),
109
- },
110
- }
111
- ).then((res) => res.json());
112
- }
113
-
114
- export function addApplication(application: string) {
115
- const newApplication = Setting.deepCopy(application);
116
- return fetch(`${Setting.ROOT_URLS.casdoor}/api/add-application`, {
117
- method: "POST",
118
- credentials: "include",
119
- body: JSON.stringify(newApplication),
120
- headers: {
121
- "Accept-Language": Setting.getAcceptLanguage(),
122
- },
123
- }).then((res) => res.json());
124
- }
125
-
126
- export function deleteApplication(application: string) {
127
- const newApplication = Setting.deepCopy(application);
128
- return fetch(`${Setting.ROOT_URLS.casdoor}/api/delete-application`, {
129
- method: "POST",
130
- credentials: "include",
131
- body: JSON.stringify(newApplication),
132
- headers: {
133
- "Accept-Language": Setting.getAcceptLanguage(),
134
- },
135
- }).then((res) => res.json());
136
- }
137
-
138
- export function getSamlMetadata(
139
- owner: string,
140
- name: string,
141
- enablePostBinding: boolean
142
- ) {
143
- return fetch(
144
- `${
145
- Setting.ROOT_URLS.casdoor
146
- }/api/saml/metadata?application=${owner}/${encodeURIComponent(
147
- name
148
- )}&enablePostBinding=${enablePostBinding}`,
149
- {
150
- method: "GET",
151
- credentials: "include",
152
- headers: {
153
- "Accept-Language": Setting.getAcceptLanguage(),
154
- },
155
- }
156
- ).then((res) => res.text());
157
- }
1
+ // https://github.com/casdoor/casdoor/blob/master/web/src/backend/ApplicationBackend.js
2
+
3
+ // Copyright 2021 The Casdoor Authors. All Rights Reserved.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 (the "License");
6
+ // you may not use this file except in compliance with the License.
7
+ // You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing, software
12
+ // distributed under the License is distributed on an "AS IS" BASIS,
13
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ // See the License for the specific language governing permissions and
15
+ // limitations under the License.
16
+
17
+ import * as Setting from "./core";
18
+
19
+ export function getApplications(
20
+ owner: string,
21
+ page = "",
22
+ pageSize = "",
23
+ field = "",
24
+ value = "",
25
+ sortField = "",
26
+ sortOrder = ""
27
+ ) {
28
+ return fetch(
29
+ `${Setting.ROOT_URLS.casdoor}/api/get-applications?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`,
30
+ {
31
+ method: "GET",
32
+ credentials: "include",
33
+ headers: {
34
+ "Accept-Language": Setting.getAcceptLanguage(),
35
+ },
36
+ }
37
+ ).then((res) => res.json());
38
+ }
39
+
40
+ export function getApplicationsByOrganization(
41
+ owner: string,
42
+ organization: string,
43
+ page = "",
44
+ pageSize = "",
45
+ field = "",
46
+ value = "",
47
+ sortField = "",
48
+ sortOrder = ""
49
+ ) {
50
+ return fetch(
51
+ `${Setting.ROOT_URLS.casdoor}/api/get-organization-applications?owner=${owner}&organization=${organization}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`,
52
+ {
53
+ method: "GET",
54
+ credentials: "include",
55
+ headers: {
56
+ "Accept-Language": Setting.getAcceptLanguage(),
57
+ },
58
+ }
59
+ ).then((res) => res.json());
60
+ }
61
+
62
+ export function getApplication(
63
+ owner: string,
64
+ name: string,
65
+ CLIENT_ID: string,
66
+ CLIENT_SECRET: string
67
+ ) {
68
+ console.log("ATTEMPTING TO GET APPLICATION");
69
+ return fetch(
70
+ `${
71
+ Setting.ROOT_URLS.casdoor
72
+ }/api/get-application?id=${owner}/${encodeURIComponent(name)}`,
73
+ {
74
+ method: "GET",
75
+ headers: {
76
+ Authorization: "Basic " + btoa(`${CLIENT_ID}:${CLIENT_SECRET}`),
77
+ "Content-Type": "application/json",
78
+ },
79
+ }
80
+ ).then((res) => res.json());
81
+ }
82
+
83
+ export function getUserApplication(owner: string, name: string) {
84
+ return fetch(
85
+ `${
86
+ Setting.ROOT_URLS.casdoor
87
+ }/api/get-user-application?id=${owner}/${encodeURIComponent(name)}`,
88
+ {
89
+ method: "GET",
90
+ credentials: "include",
91
+ headers: {
92
+ "Accept-Language": Setting.getAcceptLanguage(),
93
+ },
94
+ }
95
+ ).then((res) => res.json());
96
+ }
97
+
98
+ export function updateApplication(
99
+ owner: string,
100
+ name: string,
101
+ application: string
102
+ ) {
103
+ return fetch(
104
+ `${
105
+ Setting.ROOT_URLS.casdoor
106
+ }/api/update-application?id=${owner}/${encodeURIComponent(name)}`,
107
+ {
108
+ method: "POST",
109
+ credentials: "include",
110
+ body: JSON.stringify(application),
111
+ headers: {
112
+ "Accept-Language": Setting.getAcceptLanguage(),
113
+ },
114
+ }
115
+ ).then((res) => res.json());
116
+ }
117
+
118
+ export function addApplication(application: string) {
119
+ const newApplication = Setting.deepCopy(application);
120
+ return fetch(`${Setting.ROOT_URLS.casdoor}/api/add-application`, {
121
+ method: "POST",
122
+ credentials: "include",
123
+ body: JSON.stringify(newApplication),
124
+ headers: {
125
+ "Accept-Language": Setting.getAcceptLanguage(),
126
+ },
127
+ }).then((res) => res.json());
128
+ }
129
+
130
+ export function deleteApplication(application: string) {
131
+ const newApplication = Setting.deepCopy(application);
132
+ return fetch(`${Setting.ROOT_URLS.casdoor}/api/delete-application`, {
133
+ method: "POST",
134
+ credentials: "include",
135
+ body: JSON.stringify(newApplication),
136
+ headers: {
137
+ "Accept-Language": Setting.getAcceptLanguage(),
138
+ },
139
+ }).then((res) => res.json());
140
+ }
141
+
142
+ export function getSamlMetadata(
143
+ owner: string,
144
+ name: string,
145
+ enablePostBinding: boolean
146
+ ) {
147
+ return fetch(
148
+ `${
149
+ Setting.ROOT_URLS.casdoor
150
+ }/api/saml/metadata?application=${owner}/${encodeURIComponent(
151
+ name
152
+ )}&enablePostBinding=${enablePostBinding}`,
153
+ {
154
+ method: "GET",
155
+ credentials: "include",
156
+ headers: {
157
+ "Accept-Language": Setting.getAcceptLanguage(),
158
+ },
159
+ }
160
+ ).then((res) => res.text());
161
+ }