auth0-lock 11.35.0 → 12.0.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.
Files changed (240) hide show
  1. package/.browserslistrc +1 -0
  2. package/.circleci/config.yml +3 -1
  3. package/.shiprc +4 -5
  4. package/CHANGELOG.md +25 -0
  5. package/DEVELOPMENT.md +1 -1
  6. package/README.md +20 -16
  7. package/karma.conf.js +1 -1
  8. package/lib/CSSCore.js +1 -4
  9. package/lib/__tests__/auth_button.js +12 -22
  10. package/lib/__tests__/connection/database/actions.js +48 -49
  11. package/lib/__tests__/connection/database/index.js +22 -28
  12. package/lib/__tests__/connection/database/login_pane.js +24 -47
  13. package/lib/__tests__/connection/database/password_reset_confirmation.js +23 -32
  14. package/lib/__tests__/connection/database/reset_password.js +17 -39
  15. package/lib/__tests__/connection/database/signed_up_confirmation.js +23 -32
  16. package/lib/__tests__/connection/enterprise/actions.js +22 -47
  17. package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
  18. package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
  19. package/lib/__tests__/connection/enterprise/quick_auth_screen.js +32 -75
  20. package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
  21. package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +23 -32
  22. package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
  23. package/lib/__tests__/core/actions.js +23 -46
  24. package/lib/__tests__/core/client/index.js +10 -13
  25. package/lib/__tests__/core/index.js +46 -94
  26. package/lib/__tests__/core/remote_data.js +14 -20
  27. package/lib/__tests__/core/signed_in_confirmation.js +23 -32
  28. package/lib/__tests__/core/sso/last_login_screen.js +27 -50
  29. package/lib/__tests__/core/tenant.js +10 -12
  30. package/lib/__tests__/core/web_api/helper.js +6 -14
  31. package/lib/__tests__/core/web_api/p2_api.js +38 -33
  32. package/lib/__tests__/core/web_api.js +37 -33
  33. package/lib/__tests__/engine/classic/login.js +20 -41
  34. package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
  35. package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
  36. package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
  37. package/lib/__tests__/engine/classic.js +13 -6
  38. package/lib/__tests__/engine/passwordless/social_or_email_login_screen.js +7 -28
  39. package/lib/__tests__/engine/passwordless/social_or_phone_number_login_screen.js +7 -28
  40. package/lib/__tests__/engine/passwordless.js +2 -5
  41. package/lib/__tests__/field/captcha/recaptcha_enterprise.js +27 -27
  42. package/lib/__tests__/field/captcha/recaptchav2.js +27 -27
  43. package/lib/__tests__/field/captcha.js +39 -51
  44. package/lib/__tests__/field/custom_input.js +23 -47
  45. package/lib/__tests__/field/email.js +2 -3
  46. package/lib/__tests__/field/email_pane.js +25 -48
  47. package/lib/__tests__/field/field.js +9 -13
  48. package/lib/__tests__/field/login_pane.js +30 -34
  49. package/lib/__tests__/field/mfa_code_pane.js +13 -28
  50. package/lib/__tests__/field/option_selection_pane.js +7 -25
  51. package/lib/__tests__/field/password.js +6 -12
  52. package/lib/__tests__/field/password_pane.js +29 -46
  53. package/lib/__tests__/field/phone_number_pane.js +18 -41
  54. package/lib/__tests__/field/social_buttons_pane.js +30 -47
  55. package/lib/__tests__/field/username.js +27 -48
  56. package/lib/__tests__/field/username_pane.js +30 -47
  57. package/lib/__tests__/field/vcode.js +5 -13
  58. package/lib/__tests__/field/vcode_pane.js +20 -44
  59. package/lib/__tests__/i18n.js +28 -53
  60. package/lib/__tests__/quick-auth/actions.js +4 -27
  61. package/lib/__tests__/setup-tests.js +7 -9
  62. package/lib/__tests__/testUtils.js +41 -58
  63. package/lib/__tests__/ui/box/chrome.js +24 -49
  64. package/lib/__tests__/ui/box/confirmation_pane.js +23 -42
  65. package/lib/__tests__/ui/box/container.js +21 -46
  66. package/lib/__tests__/ui/box/global_message.js +60 -37
  67. package/lib/__tests__/ui/input/email_input.js +6 -17
  68. package/lib/__tests__/ui/input/input_wrap.js +6 -19
  69. package/lib/__tests__/ui/input/password/password_strength.js +13 -15
  70. package/lib/__tests__/ui/input/password_input.js +22 -27
  71. package/lib/__tests__/utils/format.js +10 -17
  72. package/lib/__tests__/utils/url_utils.js +2 -5
  73. package/lib/avatar/gravatar_provider.js +13 -28
  74. package/lib/avatar.js +22 -41
  75. package/lib/browser.js +372 -23
  76. package/lib/connection/captcha.js +15 -34
  77. package/lib/connection/database/actions.js +39 -108
  78. package/lib/connection/database/index.js +90 -191
  79. package/lib/connection/database/login_pane.js +107 -147
  80. package/lib/connection/database/login_sign_up_tabs.js +106 -125
  81. package/lib/connection/database/mfa_pane.js +50 -69
  82. package/lib/connection/database/password_reset_confirmation.js +51 -73
  83. package/lib/connection/database/reset_password.js +116 -132
  84. package/lib/connection/database/reset_password_pane.js +45 -56
  85. package/lib/connection/database/sign_up_terms.js +17 -23
  86. package/lib/connection/database/signed_up_confirmation.js +52 -75
  87. package/lib/connection/enterprise/actions.js +23 -52
  88. package/lib/connection/enterprise/hrd_pane.js +60 -76
  89. package/lib/connection/enterprise/hrd_screen.js +60 -75
  90. package/lib/connection/enterprise/kerberos_screen.js +46 -60
  91. package/lib/connection/enterprise/quick_auth_screen.js +46 -64
  92. package/lib/connection/enterprise/single_sign_on_notice.js +14 -26
  93. package/lib/connection/enterprise.js +51 -84
  94. package/lib/connection/passwordless/actions.js +29 -65
  95. package/lib/connection/passwordless/ask_vcode.js +53 -60
  96. package/lib/connection/passwordless/email_sent_confirmation.js +129 -179
  97. package/lib/connection/passwordless/index.js +36 -68
  98. package/lib/connection/social/index.js +12 -15
  99. package/lib/core/actions.js +33 -85
  100. package/lib/core/client/index.js +38 -58
  101. package/lib/core/client/settings.js +12 -20
  102. package/lib/core/error_screen.js +38 -52
  103. package/lib/core/index.js +154 -305
  104. package/lib/core/loading_screen.js +61 -71
  105. package/lib/core/pane_separator.js +10 -10
  106. package/lib/core/remote_data.js +30 -51
  107. package/lib/core/screen.js +85 -79
  108. package/lib/core/signed_in_confirmation.js +51 -73
  109. package/lib/core/sso/data.js +9 -17
  110. package/lib/core/sso/index.js +5 -6
  111. package/lib/core/sso/last_login_screen.js +46 -63
  112. package/lib/core/tenant/index.js +37 -59
  113. package/lib/core/tenant/settings.js +11 -15
  114. package/lib/core/web_api/helper.js +22 -28
  115. package/lib/core/web_api/p2_api.js +162 -171
  116. package/lib/core/web_api.js +106 -94
  117. package/lib/core.js +126 -160
  118. package/lib/engine/classic/login.js +92 -144
  119. package/lib/engine/classic/mfa_login_screen.js +61 -67
  120. package/lib/engine/classic/sign_up_pane.js +89 -123
  121. package/lib/engine/classic/sign_up_screen.js +112 -158
  122. package/lib/engine/classic.js +122 -183
  123. package/lib/engine/passwordless/social_or_email_login_screen.js +80 -116
  124. package/lib/engine/passwordless/social_or_phone_number_login_screen.js +79 -110
  125. package/lib/engine/passwordless.js +75 -104
  126. package/lib/field/actions.js +11 -17
  127. package/lib/field/captcha/captcha_pane.js +83 -103
  128. package/lib/field/captcha/recaptcha.js +140 -145
  129. package/lib/field/captcha.js +7 -10
  130. package/lib/field/custom_input.js +37 -50
  131. package/lib/field/email/email_pane.js +90 -109
  132. package/lib/field/email.js +17 -35
  133. package/lib/field/index.js +50 -87
  134. package/lib/field/mfa-code/mfa_code_pane.js +57 -71
  135. package/lib/field/mfa_code.js +15 -21
  136. package/lib/field/option_selection_pane.js +16 -22
  137. package/lib/field/password/password_pane.js +79 -91
  138. package/lib/field/password.js +8 -14
  139. package/lib/field/phone-number/locations.js +7 -3
  140. package/lib/field/phone-number/phone_number_pane.js +87 -124
  141. package/lib/field/phone_number.js +16 -30
  142. package/lib/field/social/event.js +9 -12
  143. package/lib/field/social/social_buttons_pane.js +93 -121
  144. package/lib/field/username/username_pane.js +105 -123
  145. package/lib/field/username.js +16 -26
  146. package/lib/field/vcode/vcode_pane.js +67 -93
  147. package/lib/field/vcode.js +5 -5
  148. package/lib/i18n/af.js +7 -4
  149. package/lib/i18n/ar.js +7 -4
  150. package/lib/i18n/az.js +7 -4
  151. package/lib/i18n/bg.js +7 -4
  152. package/lib/i18n/ca.js +7 -4
  153. package/lib/i18n/cs.js +7 -4
  154. package/lib/i18n/da.js +7 -4
  155. package/lib/i18n/de.js +7 -3
  156. package/lib/i18n/el.js +7 -4
  157. package/lib/i18n/en.js +9 -4
  158. package/lib/i18n/es.js +7 -3
  159. package/lib/i18n/et.js +7 -4
  160. package/lib/i18n/fa.js +7 -4
  161. package/lib/i18n/fi.js +7 -4
  162. package/lib/i18n/fr.js +7 -4
  163. package/lib/i18n/he.js +7 -4
  164. package/lib/i18n/hr.js +7 -4
  165. package/lib/i18n/hu.js +7 -4
  166. package/lib/i18n/id.js +7 -4
  167. package/lib/i18n/it.js +7 -3
  168. package/lib/i18n/ja.js +7 -4
  169. package/lib/i18n/ko.js +7 -4
  170. package/lib/i18n/lt.js +7 -4
  171. package/lib/i18n/lv.js +7 -4
  172. package/lib/i18n/ms.js +7 -4
  173. package/lib/i18n/nb.js +7 -4
  174. package/lib/i18n/nl.js +7 -4
  175. package/lib/i18n/nn.js +7 -4
  176. package/lib/i18n/no.js +7 -4
  177. package/lib/i18n/pl.js +7 -4
  178. package/lib/i18n/pt-br.js +7 -3
  179. package/lib/i18n/pt.js +7 -4
  180. package/lib/i18n/ro.js +7 -4
  181. package/lib/i18n/ru.js +7 -4
  182. package/lib/i18n/sk.js +7 -4
  183. package/lib/i18n/sl.js +7 -4
  184. package/lib/i18n/sr.js +7 -4
  185. package/lib/i18n/sv.js +7 -4
  186. package/lib/i18n/tr.js +7 -4
  187. package/lib/i18n/ua.js +7 -4
  188. package/lib/i18n/uk.js +7 -4
  189. package/lib/i18n/vi.js +7 -4
  190. package/lib/i18n/zh-tw.js +7 -4
  191. package/lib/i18n/zh.js +7 -4
  192. package/lib/i18n.js +38 -75
  193. package/lib/index.js +14 -17
  194. package/lib/lock.js +29 -32
  195. package/lib/passwordless.js +29 -31
  196. package/lib/quick-auth/actions.js +19 -26
  197. package/lib/quick_auth.js +8 -10
  198. package/lib/sanitizer.js +5 -5
  199. package/lib/store/index.js +22 -42
  200. package/lib/sync.js +21 -42
  201. package/lib/ui/box/button.js +85 -105
  202. package/lib/ui/box/chrome.js +463 -548
  203. package/lib/ui/box/confirmation_pane.js +34 -48
  204. package/lib/ui/box/container.js +305 -339
  205. package/lib/ui/box/global_message.js +51 -60
  206. package/lib/ui/box/header.js +155 -177
  207. package/lib/ui/box/multisize_slide.js +233 -229
  208. package/lib/ui/box/success_pane.js +34 -37
  209. package/lib/ui/box.js +88 -93
  210. package/lib/ui/button/auth_button.js +44 -51
  211. package/lib/ui/input/captcha_input.js +162 -181
  212. package/lib/ui/input/checkbox_input.js +57 -59
  213. package/lib/ui/input/email_input.js +117 -124
  214. package/lib/ui/input/input_wrap.js +65 -80
  215. package/lib/ui/input/location_input.js +130 -150
  216. package/lib/ui/input/mfa_code_input.js +98 -98
  217. package/lib/ui/input/password/password_strength.js +103 -127
  218. package/lib/ui/input/password_input.js +141 -147
  219. package/lib/ui/input/phone_number_input.js +101 -109
  220. package/lib/ui/input/select_input.js +120 -132
  221. package/lib/ui/input/text_input.js +89 -84
  222. package/lib/ui/input/username_input.js +109 -115
  223. package/lib/ui/input/vcode_input.js +110 -118
  224. package/lib/ui/list.js +224 -247
  225. package/lib/ui/pane/quick_auth_pane.js +55 -80
  226. package/lib/utils/atom.js +55 -48
  227. package/lib/utils/cache.js +54 -43
  228. package/lib/utils/cdn_utils.js +17 -31
  229. package/lib/utils/createRef.js +3 -1
  230. package/lib/utils/data_utils.js +10 -16
  231. package/lib/utils/fn_utils.js +5 -4
  232. package/lib/utils/format.js +6 -8
  233. package/lib/utils/id_utils.js +4 -3
  234. package/lib/utils/jsonp_utils.js +20 -17
  235. package/lib/utils/media_utils.js +4 -2
  236. package/lib/utils/preload_utils.js +4 -3
  237. package/lib/utils/string_utils.js +4 -4
  238. package/lib/utils/url_utils.js +4 -3
  239. package/package.json +48 -34
  240. package/webpack.config.js +36 -3
@@ -0,0 +1 @@
1
+ defaults, last 2 versions, not dead, IE 11
@@ -1,6 +1,6 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ship: auth0/ship@0.2.0
3
+ ship: auth0/ship@0
4
4
  executors:
5
5
  docker-executor:
6
6
  docker:
@@ -81,6 +81,7 @@ workflows:
81
81
  requires:
82
82
  - build-and-test
83
83
  pkg-manager: yarn
84
+ node-version: 18.12.1
84
85
  context:
85
86
  - publish-npm
86
87
  - publish-gh
@@ -88,3 +89,4 @@ workflows:
88
89
  branches:
89
90
  only:
90
91
  - master
92
+ - beta
package/.shiprc CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
- "files": {
3
- "bower.json": [],
4
- "README.md": []
5
- },
6
- "postbump": "yarn dist build"
2
+ "files": {
3
+ "README.md": []
4
+ },
5
+ "postbump": "yarn dist build"
7
6
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Change Log
2
2
 
3
+ ## [v12.0.0](https://github.com/auth0/lock/tree/v12.0.0) (2023-01-20)
4
+
5
+ [Full Changelog](https://github.com/auth0/lock/compare/v11.35.0...v12.0.0)
6
+
7
+ Lock is now built using React 18, which resolves a number of security vulnerabilities and improves performance. If you encounter any issues relating to this upgrade, please [submit a bug report](https://github.com/auth0/lock/issues/new?assignees=&labels=bug+report,v12&template=report_a_bug.md&title=).
8
+
9
+ Despite the major version bump, **v12 is completely API-compatible with v11**.
10
+
11
+ **Changed**
12
+
13
+ - Upgrade to React 18 [\#2209](https://github.com/auth0/lock/pull/2209) ([stevehobbsdev](https://github.com/stevehobbsdev))
14
+ - Upgrade to Webpack 5 [\#2213](https://github.com/auth0/lock/pull/2213) ([stevehobbsdev](https://github.com/stevehobbsdev))
15
+ - Various dependency bumps [see the full changelog](https://github.com/auth0/lock/compare/v11.35.0...v12.0.0)
16
+
3
17
  ## [v11.35.0](https://github.com/auth0/lock/tree/v11.35.0) (2022-12-19)
4
18
 
5
19
  [Full Changelog](https://github.com/auth0/lock/compare/v11.34.2...v11.35.0)
@@ -18,6 +32,17 @@
18
32
  - Update okta logo [\#2201](https://github.com/auth0/lock/pull/2201) ([jamescgarrett](https://github.com/jamescgarrett))
19
33
  - Update readme to match new design [\#2187](https://github.com/auth0/lock/pull/2187) ([ewanharris](https://github.com/ewanharris))
20
34
 
35
+ ## [v12.0.0-beta.0](https://github.com/auth0/lock/tree/v12.0.0-beta.0) (2022-12-08)
36
+
37
+ [Full Changelog](https://github.com/auth0/lock/compare/v11.34.2...v12.0.0-beta.0)
38
+
39
+ :warning: This is a **beta release** of Lock.js v12 that includes an upgrade to React 18, and should not be used in production. If you find any issues, please [submit a bug report](https://github.com/auth0/lock/issues/new?assignees=&labels=bug+report,v12-beta&template=report_a_bug.md&title=).
40
+
41
+ **Changed**
42
+
43
+ - Upgrade to React 18 [\#2209](https://github.com/auth0/lock/pull/2209) ([stevehobbsdev](https://github.com/stevehobbsdev))
44
+ - Upgrade to Webpack 5, Jest 29, Babel 8 [\#2213](https://github.com/auth0/lock/pull/2213) ([stevehobbsdev](https://github.com/stevehobbsdev))
45
+ - bump dependencies to latest patch and fix typos [\#2210](https://github.com/auth0/lock/pull/2210) ([piwysocki](https://github.com/piwysocki))
21
46
  ## [v11.34.2](https://github.com/auth0/lock/tree/v11.34.2) (2022-10-10)
22
47
 
23
48
  [Full Changelog](https://github.com/auth0/lock/compare/v11.34.1...v11.34.2)
package/DEVELOPMENT.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Requires:
4
4
 
5
5
  - [Yarn](https://yarnpkg.com/)
6
- - >= Node 10.18.1
6
+ - [Node LTS](https://nodejs.org)
7
7
 
8
8
  ## Building
9
9
 
package/README.md CHANGED
@@ -1,22 +1,26 @@
1
1
  ![Auth0's configurable login form for web applications](https://cdn.auth0.com/website/sdks/banners/lock-banner.png)
2
-
3
2
  ![Release](https://img.shields.io/npm/v/auth0-lock)
4
3
  ![Downloads](https://img.shields.io/npm/dw/auth0-lock)
5
4
  [![License](https://img.shields.io/:license-mit-blue.svg?style=flat)](https://opensource.org/licenses/MIT)
6
5
  ![CircleCI](https://img.shields.io/circleci/build/github/auth0/lock)
7
6
 
8
- ## Documentation
7
+ > :warning: Lock is built using React 18 from v12 onwards. Getting issues? Please [submit a bug report](https://github.com/auth0/lock/issues/new?assignees=&labels=bug+report,v12&template=report_a_bug.md&title=).
8
+
9
+ > :warning: From v12 onwards, we no longer publish to Bower.
10
+
11
+ ## Documentation
9
12
 
10
13
  - [Docs Site](https://auth0.com/docs) - explore our Docs site and learn more about Auth0.
11
14
 
12
15
  ## Getting Started
16
+
13
17
  ### Browser Compatibility
14
18
 
15
- We ensure browser compatibility in Chrome, Safari, Firefox and IE >= 10.
19
+ We ensure browser compatibility in Chrome, Safari, Firefox and IE >= 11.
16
20
 
17
21
  ### Installation
18
22
 
19
- Using [npm](https://npmjs.org) in your project directory run the following command:
23
+ Install Lock into your project using [npm](https://npmjs.org):
20
24
 
21
25
  ```sh
22
26
  npm install auth0-lock
@@ -26,9 +30,8 @@ From CDN
26
30
 
27
31
  ```html
28
32
  <!-- Latest patch release (recommended for production) -->
29
- <script src="https://cdn.auth0.com/js/lock/11.35.0/lock.min.js"></script>
33
+ <script src="https://cdn.auth0.com/js/lock/12.0.0/lock.min.js"></script>
30
34
  ```
31
-
32
35
  ### Configure Auth0
33
36
 
34
37
  Create a **Single Page Application** in the [Auth0 Dashboard](https://manage.auth0.com/#/applications).
@@ -40,44 +43,44 @@ Create a **Single Page Application** in the [Auth0 Dashboard](https://manage.aut
40
43
  > - Scroll down and click on the "Show Advanced Settings" link.
41
44
  > - Under "Advanced Settings", click on the "OAuth" tab.
42
45
  > - Ensure that "JsonWebToken Signature Algorithm" is set to `RS256` and that "OIDC Conformant" is enabled.
43
- Next, configure the following URLs for your application under the "Application URIs" section of the "Settings" page:
46
+ > Next, configure the following URLs for your application under the "Application URIs" section of the "Settings" page:
44
47
 
45
48
  - **Allowed Callback URLs**: `http://localhost:3000`
46
49
  - **Allowed Logout URLs**: `http://localhost:3000`
47
50
  - **Allowed Web Origins**: `http://localhost:3000`
48
51
 
49
52
  > These URLs should reflect the origins that your application is running on. **Allowed Callback URLs** may also include a path, depending on where you're handling the callback (see below).
50
- Take note of the **Client ID** and **Domain** values under the "Basic Information" section. You'll need these values in the next step.
53
+ > Take note of the **Client ID** and **Domain** values under the "Basic Information" section. You'll need these values in the next step.
51
54
 
52
55
  ### Configure the SDK
53
56
 
54
- Create either an `Auth0Lock` or `Auth0LockPasswordless` instance.
57
+ Create either an `Auth0Lock` or `Auth0LockPasswordless` instance, depending on your use case:
55
58
 
56
59
  #### Auth0Lock
57
60
 
58
- ````js
61
+ ```js
59
62
  import { Auth0Lock } from 'auth0-lock';
60
63
 
61
64
  const lock = new Auth0Lock('{YOUR_AUTH0_CLIENT_ID}', '{YOUR_AUTH0_DOMAIN}');
62
- ````
65
+ ```
63
66
 
64
67
  #### Auth0LockPasswordless
65
68
 
66
- ````js
69
+ ```js
67
70
  import { Auth0LockPasswordless } from 'auth0-lock';
68
71
 
69
72
  const lock = new Auth0LockPasswordless('{YOUR_AUTH0_CLIENT_ID}', '{YOUR_AUTH0_DOMAIN}');
70
- ````
73
+ ```
71
74
 
72
75
  ### Logging In
73
76
 
74
- You can then configure a listener for the `authenticated` event to retrieve an access token and call `show` to display the Lock widget.
77
+ Configure a listener for the `authenticated` event to retrieve an access token and call `show` to display the Lock widget.
75
78
 
76
79
  ```html
77
80
  <button id="login">Click to Login</button>
78
81
  ```
79
82
 
80
- ````js
83
+ ```js
81
84
  lock.on('authenticated', function (authResult) {
82
85
  lock.getUserInfo(authResult.accessToken, function (error, profileResult) {
83
86
  if (error) {
@@ -92,10 +95,11 @@ lock.on('authenticated', function (authResult) {
92
95
  });
93
96
  });
94
97
 
98
+ // Show the widget when the login button is clicked
95
99
  document.getElementById('login').addEventListener('click', () => {
96
100
  lock.show()
97
101
  });.
98
- ````
102
+ ```
99
103
 
100
104
  For other comprehensive examples and documentation on the configuration options, see the [EXAMPLES.md](https://github.com/auth0/lock/blob/master/EXAMPLES.md) document.
101
105
 
package/karma.conf.js CHANGED
@@ -118,6 +118,6 @@ module.exports = function (config) {
118
118
  }
119
119
  },
120
120
 
121
- browsers: ['bs_chrome_windows']
121
+ browsers: ['bs_chrome_windows', 'bs_ie11_windows']
122
122
  });
123
123
  };
package/lib/CSSCore.js CHANGED
@@ -16,7 +16,6 @@
16
16
  * display and not reading it as no logical state should be encoded in the
17
17
  * display of elements.
18
18
  */
19
-
20
19
  var CSSCore = {
21
20
  /**
22
21
  * Adds the class passed in to the element if it doesn't already have it.
@@ -35,7 +34,6 @@ var CSSCore = {
35
34
  }
36
35
  return element;
37
36
  },
38
-
39
37
  /**
40
38
  * Removes the class passed in from the element
41
39
  *
@@ -52,9 +50,9 @@ var CSSCore = {
52
50
  .replace(/^\s*|\s*$/g, ''); // trim the ends
53
51
  }
54
52
  }
53
+
55
54
  return element;
56
55
  },
57
-
58
56
  /**
59
57
  * Tests whether the element has the class specified.
60
58
  *
@@ -69,5 +67,4 @@ var CSSCore = {
69
67
  return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
70
68
  }
71
69
  };
72
-
73
70
  module.exports = CSSCore;
@@ -1,21 +1,11 @@
1
- 'use strict';
2
-
3
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
4
-
5
- var _react = require('react');
6
-
7
- var _react2 = _interopRequireDefault(_react);
8
-
9
- var _enzyme = require('enzyme');
10
-
11
- var _testUtils = require('testUtils');
12
-
13
- var _auth_button = require('ui/button/auth_button');
14
-
15
- var _auth_button2 = _interopRequireDefault(_auth_button);
1
+ "use strict";
16
2
 
3
+ var _react = _interopRequireDefault(require("react"));
4
+ var _enzyme = require("enzyme");
5
+ var _testUtils = require("testUtils");
6
+ var _auth_button = _interopRequireDefault(require("ui/button/auth_button"));
17
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
-
8
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
9
  describe('AuthButton', function () {
20
10
  var defaultProps = {
21
11
  label: 'label',
@@ -23,17 +13,17 @@ describe('AuthButton', function () {
23
13
  strategy: 'strategy'
24
14
  };
25
15
  it('renders correctly', function () {
26
- (0, _testUtils.expectComponent)(_react2.default.createElement(_auth_button2.default, defaultProps)).toMatchSnapshot();
16
+ (0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(_auth_button.default, defaultProps)).toMatchSnapshot();
27
17
  });
28
18
  it('renders with style customizations', function () {
29
- (0, _testUtils.expectComponent)(_react2.default.createElement(_auth_button2.default, _extends({}, defaultProps, {
30
- icon: 'test',
31
- primaryColor: 'primaryColor',
32
- foregroundColor: 'foregroundColor'
19
+ (0, _testUtils.expectComponent)( /*#__PURE__*/_react.default.createElement(_auth_button.default, _extends({}, defaultProps, {
20
+ icon: "test",
21
+ primaryColor: "primaryColor",
22
+ foregroundColor: "foregroundColor"
33
23
  }))).toMatchSnapshot();
34
24
  });
35
25
  it('should trigger onClick when clicked', function () {
36
- var wrapper = (0, _enzyme.mount)(_react2.default.createElement(_auth_button2.default, defaultProps));
26
+ var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_auth_button.default, defaultProps));
37
27
  wrapper.find('a').simulate('click');
38
28
  expect(defaultProps.onClick.mock.calls.length).toBe(1);
39
29
  });
@@ -1,15 +1,11 @@
1
- 'use strict';
2
-
3
- var _immutable = require('immutable');
4
-
5
- var _immutable2 = _interopRequireDefault(_immutable);
6
-
7
- var _actions = require('../../../connection/database/actions');
8
-
9
- var _store = require('../../../store');
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ var _immutable = _interopRequireWildcard(require("immutable"));
5
+ var _actions = require("../../../connection/database/actions");
6
+ var _store = require("../../../store");
7
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
8
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
9
  var webApiMock = function webApiMock() {
14
10
  return require('core/web_api');
15
11
  };
@@ -21,32 +17,27 @@ jest.mock('core/actions', function () {
21
17
  validateAndSubmit: jest.fn()
22
18
  };
23
19
  });
24
-
25
20
  jest.mock('core/web_api', function () {
26
21
  return {
27
22
  signUp: jest.fn()
28
23
  };
29
24
  });
30
-
31
25
  describe('database/actions.js', function () {
32
26
  beforeEach(function () {
33
27
  jest.resetAllMocks();
34
28
  });
35
-
36
29
  it('signUp splits root attributes correctly', function () {
37
30
  var id = 1;
38
31
  var hookRunner = jest.fn(function (str, m, context, fn) {
39
32
  return fn();
40
33
  });
41
-
42
34
  require('connection/database/index').databaseConnectionName = function () {
43
35
  return 'test-connection';
44
36
  };
45
37
  require('connection/database/index').shouldAutoLogin = function () {
46
38
  return true;
47
39
  };
48
-
49
- var m = _immutable2.default.fromJS({
40
+ var m = _immutable.default.fromJS({
50
41
  field: {
51
42
  email: {
52
43
  value: 'test@email.com'
@@ -74,7 +65,24 @@ describe('database/actions.js', function () {
74
65
  }
75
66
  },
76
67
  database: {
77
- additionalSignUpFields: [{ name: 'family_name', storage: 'root' }, { name: 'given_name', storage: 'root' }, { name: 'name', storage: 'root' }, { name: 'nickname', storage: 'root' }, { name: 'picture', storage: 'root' }, { name: 'other_prop' }]
68
+ additionalSignUpFields: [{
69
+ name: 'family_name',
70
+ storage: 'root'
71
+ }, {
72
+ name: 'given_name',
73
+ storage: 'root'
74
+ }, {
75
+ name: 'name',
76
+ storage: 'root'
77
+ }, {
78
+ name: 'nickname',
79
+ storage: 'root'
80
+ }, {
81
+ name: 'picture',
82
+ storage: 'root'
83
+ }, {
84
+ name: 'other_prop'
85
+ }]
78
86
  },
79
87
  core: {
80
88
  hookRunner: hookRunner
@@ -82,19 +90,15 @@ describe('database/actions.js', function () {
82
90
  });
83
91
  (0, _store.swap)(_store.setEntity, 'lock', id, m);
84
92
  (0, _actions.signUp)(id);
85
-
86
93
  var _coreActionsMock = coreActionsMock(),
87
- validateAndSubmitMock = _coreActionsMock.validateAndSubmit.mock;
88
-
94
+ validateAndSubmitMock = _coreActionsMock.validateAndSubmit.mock;
89
95
  expect(validateAndSubmitMock.calls.length).toBe(1);
90
96
  expect(validateAndSubmitMock.calls[0][0]).toBe(id);
91
97
  expect(validateAndSubmitMock.calls[0][1]).toContain('email');
92
98
  expect(validateAndSubmitMock.calls[0][1]).toContain('password');
93
99
  validateAndSubmitMock.calls[0][2](m);
94
-
95
100
  var _webApiMock = webApiMock(),
96
- signUpMock = _webApiMock.signUp.mock;
97
-
101
+ signUpMock = _webApiMock.signUp.mock;
98
102
  expect(signUpMock.calls.length).toBe(1);
99
103
  expect(signUpMock.calls[0][0]).toBe(id);
100
104
  expect(signUpMock.calls[0][1]).toMatchObject({
@@ -112,22 +116,18 @@ describe('database/actions.js', function () {
112
116
  }
113
117
  });
114
118
  });
115
-
116
119
  it('runs the signingUp hook on signUp', function () {
117
120
  var id = 1;
118
-
119
121
  require('connection/database/index').databaseConnectionName = function () {
120
122
  return 'test-connection';
121
123
  };
122
124
  require('connection/database/index').shouldAutoLogin = function () {
123
125
  return true;
124
126
  };
125
-
126
127
  var hookRunner = jest.fn(function (str, m, context, fn) {
127
128
  return fn();
128
129
  });
129
-
130
- var m = _immutable2.default.fromJS({
130
+ var m = _immutable.default.fromJS({
131
131
  field: {
132
132
  email: {
133
133
  value: 'test@email.com'
@@ -140,31 +140,23 @@ describe('database/actions.js', function () {
140
140
  hookRunner: hookRunner
141
141
  }
142
142
  });
143
-
144
143
  (0, _store.swap)(_store.setEntity, 'lock', id, m);
145
-
146
144
  (0, _actions.signUp)(id);
147
-
148
145
  var _coreActionsMock2 = coreActionsMock(),
149
- validateAndSubmitMock = _coreActionsMock2.validateAndSubmit.mock;
150
-
146
+ validateAndSubmitMock = _coreActionsMock2.validateAndSubmit.mock;
151
147
  validateAndSubmitMock.calls[0][2](m);
152
-
153
148
  var _webApiMock2 = webApiMock(),
154
- signUpMock = _webApiMock2.signUp.mock;
155
-
149
+ signUpMock = _webApiMock2.signUp.mock;
156
150
  expect(hookRunner).toHaveBeenCalledTimes(1);
157
151
  expect(hookRunner).toHaveBeenCalledWith('signingUp', m, null, expect.any(Function));
158
152
  expect(signUpMock.calls.length).toBe(1);
159
153
  expect(signUpMock.calls[0][0]).toBe(id);
160
154
  });
161
-
162
155
  it('sanitizes additionalSignUp fields using dompurify', function () {
163
156
  var id = 1;
164
157
  var hookRunner = jest.fn(function (str, m, context, fn) {
165
158
  return fn();
166
159
  });
167
-
168
160
  require('connection/database/index').databaseConnectionName = function () {
169
161
  return 'test-connection';
170
162
  };
@@ -174,7 +166,7 @@ describe('database/actions.js', function () {
174
166
 
175
167
  // Test different fields using some examples from DOMPurify
176
168
  // https://github.com/cure53/DOMPurify#some-purification-samples-please
177
- var m = _immutable2.default.fromJS({
169
+ var m = _immutable.default.fromJS({
178
170
  field: {
179
171
  email: {
180
172
  value: 'test@email.com'
@@ -185,6 +177,7 @@ describe('database/actions.js', function () {
185
177
  family_name: {
186
178
  value: 'Test <a href="https://www.google.co.uk">Fake link</a>' // HTML but not malicious
187
179
  },
180
+
188
181
  given_name: {
189
182
  value: '<img src=x onerror=alert(1)//>'
190
183
  },
@@ -196,24 +189,30 @@ describe('database/actions.js', function () {
196
189
  }
197
190
  },
198
191
  database: {
199
- additionalSignUpFields: [{ name: 'family_name', storage: 'root' }, { name: 'given_name', storage: 'root' }, { name: 'name', storage: 'root' }, { name: 'other_name' }]
192
+ additionalSignUpFields: [{
193
+ name: 'family_name',
194
+ storage: 'root'
195
+ }, {
196
+ name: 'given_name',
197
+ storage: 'root'
198
+ }, {
199
+ name: 'name',
200
+ storage: 'root'
201
+ }, {
202
+ name: 'other_name'
203
+ }]
200
204
  },
201
205
  core: {
202
206
  hookRunner: hookRunner
203
207
  }
204
208
  });
205
-
206
209
  (0, _store.swap)(_store.setEntity, 'lock', id, m);
207
210
  (0, _actions.signUp)(id);
208
-
209
211
  var _coreActionsMock3 = coreActionsMock(),
210
- validateAndSubmitMock = _coreActionsMock3.validateAndSubmit.mock;
211
-
212
+ validateAndSubmitMock = _coreActionsMock3.validateAndSubmit.mock;
212
213
  validateAndSubmitMock.calls[0][2](m);
213
-
214
214
  var _webApiMock3 = webApiMock(),
215
- signUpMock = _webApiMock3.signUp.mock;
216
-
215
+ signUpMock = _webApiMock3.signUp.mock;
217
216
  expect(signUpMock.calls[0][1]).toMatchObject({
218
217
  connection: 'test-connection',
219
218
  email: 'test@email.com',
@@ -1,17 +1,14 @@
1
- 'use strict';
2
-
3
- var _immutable = require('immutable');
4
-
5
- var _immutable2 = _interopRequireDefault(_immutable);
6
-
7
- var _database = require('../../../connection/database');
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1
+ "use strict";
10
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ var _immutable = _interopRequireWildcard(require("immutable"));
5
+ var _database = require("../../../connection/database");
6
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
7
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
8
  describe('database/index.js', function () {
12
9
  describe('databaseUsernameValue', function () {
13
10
  var getModel = function getModel(email, username, usernameRequired) {
14
- return _immutable2.default.fromJS({
11
+ return _immutable.default.fromJS({
15
12
  field: {
16
13
  email: {
17
14
  value: email
@@ -31,49 +28,44 @@ describe('database/index.js', function () {
31
28
  }
32
29
  });
33
30
  };
34
-
35
31
  beforeEach(function () {
36
32
  jest.resetAllMocks();
37
33
  });
38
-
39
34
  describe('for database connection without username required', function () {
40
35
  var model = getModel('user@auth0.com', null, false);
41
-
42
36
  it('should get the email', function () {
43
37
  expect((0, _database.databaseUsernameValue)(model)).toEqual('user@auth0.com');
44
38
  });
45
39
  });
46
-
47
40
  describe('for database connection with username required', function () {
48
41
  var model = getModel('user@auth0.com', 'user', true);
49
-
50
42
  it('should get the username when `emailFirst` is not set', function () {
51
43
  expect((0, _database.databaseUsernameValue)(model)).toEqual('user');
52
44
  });
53
45
  it('should get the username when `emailFirst` is false', function () {
54
- expect((0, _database.databaseUsernameValue)(model, { emailFirst: false })).toEqual('user');
46
+ expect((0, _database.databaseUsernameValue)(model, {
47
+ emailFirst: false
48
+ })).toEqual('user');
55
49
  });
56
50
  it('should get the email when `emailFirst` is true', function () {
57
- expect((0, _database.databaseUsernameValue)(model, { emailFirst: true })).toEqual('user@auth0.com');
51
+ expect((0, _database.databaseUsernameValue)(model, {
52
+ emailFirst: true
53
+ })).toEqual('user@auth0.com');
58
54
  });
59
-
60
55
  describe('and only email address is filled in', function () {
61
56
  var model = getModel('user@auth0.com', null, true);
62
-
63
57
  it('should get the email address', function () {
64
58
  expect((0, _database.databaseUsernameValue)(model)).toEqual('user@auth0.com');
65
59
  });
66
60
  });
67
61
  });
68
62
  });
69
-
70
63
  describe('databaseUsernameStyle', function () {
71
64
  beforeEach(function () {
72
65
  jest.resetAllMocks();
73
66
  });
74
-
75
67
  it('it should resolve to "username" if a connectionResolver is present', function () {
76
- var model = _immutable2.default.fromJS({
68
+ var model = _immutable.default.fromJS({
77
69
  core: {
78
70
  connectionResolver: function connectionResolver() {
79
71
  return true;
@@ -87,15 +79,13 @@ describe('database/index.js', function () {
87
79
  }
88
80
  }
89
81
  });
90
-
91
82
  expect((0, _database.databaseUsernameStyle)(model)).toBe('username');
92
83
  });
93
84
  });
94
-
95
85
  describe('initDatabase', function () {
96
86
  describe('calls initNS with the correct additionalSignUpFields', function () {
97
87
  describe('uses the `storage` attribute', function () {
98
- var model = _immutable2.default.fromJS({});
88
+ var model = _immutable.default.fromJS({});
99
89
  var modelOut = (0, _database.initDatabase)(model, {
100
90
  additionalSignUpFields: [{
101
91
  type: 'hidden',
@@ -113,7 +103,7 @@ describe('database/index.js', function () {
113
103
  }]);
114
104
  });
115
105
  describe('with a valid hidden field', function () {
116
- var model = _immutable2.default.fromJS({});
106
+ var model = _immutable.default.fromJS({});
117
107
  var modelOut = (0, _database.initDatabase)(model, {
118
108
  additionalSignUpFields: [{
119
109
  type: 'hidden',
@@ -123,7 +113,11 @@ describe('database/index.js', function () {
123
113
  });
124
114
  var modelOutJS = modelOut.toJS();
125
115
  expect(modelOutJS.field).toEqual({
126
- hidden_field: { showInvalid: false, valid: true, value: 'hidden_value' }
116
+ hidden_field: {
117
+ showInvalid: false,
118
+ valid: true,
119
+ value: 'hidden_value'
120
+ }
127
121
  });
128
122
  expect(modelOutJS.database.additionalSignUpFields).toEqual([{
129
123
  type: 'hidden',
@@ -132,7 +126,7 @@ describe('database/index.js', function () {
132
126
  }]);
133
127
  });
134
128
  describe('with a hidden field without a value', function () {
135
- var model = _immutable2.default.fromJS({});
129
+ var model = _immutable.default.fromJS({});
136
130
  var modelOut = (0, _database.initDatabase)(model, {
137
131
  additionalSignUpFields: [{
138
132
  type: 'hidden',