@nymphjs/tilmeld-components 1.0.0-beta.135 → 1.0.0-beta.136

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.
@@ -20,144 +20,156 @@
20
20
  <Title id="tilmeld-two-factor-title">{title}</Title>
21
21
  {#if hasTOTPSecret === false}
22
22
  <Content id="tilmeld-two-factor-content">
23
- {#if totpSecret == null}
24
- <p>
25
- 2 Factor Authentication (2FA) adds an additional layer of security.
26
- With 2FA, no one can log in without your authenticator device, even
27
- with your password.
28
- </p>
29
-
30
- <p>
31
- You'll need an authenticator app that supports TOTP codes. Some
32
- popular apps are linked here.
33
- </p>
34
-
35
- <h6 style="margin-top: 0;">Twilio Authy</h6>
36
-
37
- <ul>
38
- <li>
39
- <a
40
- href="https://play.google.com/store/apps/details?id=com.authy.authy"
41
- target="_blank"
42
- rel="noopener noreferrer">Google Play Store</a
43
- >
44
- </li>
45
- <li>
46
- <a
47
- href="https://apps.apple.com/us/app/twilio-authy/id494168017"
48
- target="_blank"
49
- rel="noopener noreferrer">Apple App Store</a
50
- >
51
- </li>
52
- <li>
53
- <a
54
- href="https://authy.com/download/"
55
- target="_blank"
56
- rel="noopener noreferrer">Desktop App</a
57
- >
58
- </li>
59
- </ul>
60
-
61
- <h6 style="margin-top: 0;">Google Authenticator</h6>
62
-
63
- <ul>
64
- <li>
65
- <a
66
- href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2"
67
- target="_blank"
68
- rel="noopener noreferrer">Google Play Store</a
69
- >
70
- </li>
71
- <li>
72
- <a
73
- href="https://apps.apple.com/us/app/google-authenticator/id388497605"
74
- target="_blank"
75
- rel="noopener noreferrer">Apple App Store</a
76
- >
77
- </li>
78
- </ul>
79
-
80
- <h6 style="margin-top: 0;">Microsoft Authenticator</h6>
81
-
82
- <ul>
83
- <li>
84
- <a
85
- href="https://play.google.com/store/apps/details?id=com.azure.authenticator"
86
- target="_blank"
87
- rel="noopener noreferrer">Google Play Store</a
88
- >
89
- </li>
90
- <li>
91
- <a
92
- href="https://apps.apple.com/us/app/microsoft-authenticator/id983156458"
93
- target="_blank"
94
- rel="noopener noreferrer">Apple App Store</a
95
- >
96
- </li>
97
- </ul>
98
-
99
- <p>
100
- Once your authenticator app is ready, continue to generate a QR
101
- code.
102
- </p>
103
- {:else}
104
- <p>Scan this QR code with your authenticator app:</p>
105
-
106
- <div style="text-align: center;">
107
- <img alt="TOTP Set Up QR Code" src={totpSecret.qrcode} />
108
- </div>
109
-
110
- <p>Or you can enter this code manually into your app:</p>
111
-
112
- <div style="text-align: center;">
113
- <code style="word-break: break-all;">{totpSecret.secret}</code>
114
- </div>
115
-
116
- <p>Enter your password to allow this account change:</p>
117
-
118
- <div>
119
- <Textfield
120
- bind:value={password}
121
- label="Password"
122
- type="password"
123
- style="width: 100%;"
124
- input$autocomplete="current-password"
125
- {...prefixFilter(restProps, 'password$')}
126
- />
127
- </div>
128
-
129
- <p>
130
- Enter a code generated by your app to confirm the account is
131
- configured correctly:
132
- </p>
133
-
134
- <div>
135
- <Textfield
136
- bind:value={code}
137
- label="2FA Code"
138
- style="width: 100%;"
139
- input$maxlength={6}
140
- input$minlength={6}
141
- {...prefixFilter(restProps, 'code$')}
142
- />
143
- </div>
144
- {/if}
145
-
146
- {#if failureMessage}
147
- <div class="tilmeld-two-factor-failure">
148
- {failureMessage}
149
- </div>
150
- {/if}
151
-
152
- {#if loading}
153
- <div class="tilmeld-two-factor-loading">
154
- <CircularProgress
155
- style="height: 24px; width: 24px;"
156
- indeterminate
157
- {...prefixFilter(restProps, 'progress$')}
158
- />
159
- </div>
160
- {/if}
23
+ <form
24
+ onsubmit={preventDefault(
25
+ stopPropagation(() => {
26
+ if (totpSecret == null) {
27
+ beginSetup();
28
+ } else {
29
+ enableTOTP();
30
+ }
31
+ }),
32
+ )}
33
+ >
34
+ {#if totpSecret == null}
35
+ <p>
36
+ 2 Factor Authentication (2FA) adds an additional layer of
37
+ security. With 2FA, no one can log in without your authenticator
38
+ device, even with your password.
39
+ </p>
40
+
41
+ <p>
42
+ You'll need an authenticator app that supports TOTP codes. Some
43
+ popular apps are linked here.
44
+ </p>
45
+
46
+ <h6 style="margin-top: 0;">Twilio Authy</h6>
47
+
48
+ <ul>
49
+ <li>
50
+ <a
51
+ href="https://play.google.com/store/apps/details?id=com.authy.authy"
52
+ target="_blank"
53
+ rel="noopener noreferrer">Google Play Store</a
54
+ >
55
+ </li>
56
+ <li>
57
+ <a
58
+ href="https://apps.apple.com/us/app/twilio-authy/id494168017"
59
+ target="_blank"
60
+ rel="noopener noreferrer">Apple App Store</a
61
+ >
62
+ </li>
63
+ <li>
64
+ <a
65
+ href="https://authy.com/download/"
66
+ target="_blank"
67
+ rel="noopener noreferrer">Desktop App</a
68
+ >
69
+ </li>
70
+ </ul>
71
+
72
+ <h6 style="margin-top: 0;">Google Authenticator</h6>
73
+
74
+ <ul>
75
+ <li>
76
+ <a
77
+ href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2"
78
+ target="_blank"
79
+ rel="noopener noreferrer">Google Play Store</a
80
+ >
81
+ </li>
82
+ <li>
83
+ <a
84
+ href="https://apps.apple.com/us/app/google-authenticator/id388497605"
85
+ target="_blank"
86
+ rel="noopener noreferrer">Apple App Store</a
87
+ >
88
+ </li>
89
+ </ul>
90
+
91
+ <h6 style="margin-top: 0;">Microsoft Authenticator</h6>
92
+
93
+ <ul>
94
+ <li>
95
+ <a
96
+ href="https://play.google.com/store/apps/details?id=com.azure.authenticator"
97
+ target="_blank"
98
+ rel="noopener noreferrer">Google Play Store</a
99
+ >
100
+ </li>
101
+ <li>
102
+ <a
103
+ href="https://apps.apple.com/us/app/microsoft-authenticator/id983156458"
104
+ target="_blank"
105
+ rel="noopener noreferrer">Apple App Store</a
106
+ >
107
+ </li>
108
+ </ul>
109
+
110
+ <p>
111
+ Once your authenticator app is ready, continue to generate a QR
112
+ code.
113
+ </p>
114
+ {:else}
115
+ <p>Scan this QR code with your authenticator app:</p>
116
+
117
+ <div style="text-align: center;">
118
+ <img alt="TOTP Set Up QR Code" src={totpSecret.qrcode} />
119
+ </div>
120
+
121
+ <p>Or you can enter this code manually into your app:</p>
122
+
123
+ <div style="text-align: center;">
124
+ <code style="word-break: break-all;">{totpSecret.secret}</code>
125
+ </div>
126
+
127
+ <p>Enter your password to allow this account change:</p>
128
+
129
+ <div>
130
+ <Textfield
131
+ bind:value={password}
132
+ label="Password"
133
+ type="password"
134
+ style="width: 100%;"
135
+ input$autocomplete="current-password"
136
+ {...prefixFilter(restProps, 'password$')}
137
+ />
138
+ </div>
139
+
140
+ <p>
141
+ Enter a code generated by your app to confirm the account is
142
+ configured correctly:
143
+ </p>
144
+
145
+ <div>
146
+ <Textfield
147
+ bind:value={code}
148
+ label="2FA Code"
149
+ style="width: 100%;"
150
+ input$maxlength={6}
151
+ input$minlength={6}
152
+ {...prefixFilter(restProps, 'code$')}
153
+ />
154
+ </div>
155
+ {/if}
156
+
157
+ {#if failureMessage}
158
+ <div class="tilmeld-two-factor-failure">
159
+ {failureMessage}
160
+ </div>
161
+ {/if}
162
+
163
+ {#if loading}
164
+ <div class="tilmeld-two-factor-loading">
165
+ <CircularProgress
166
+ style="height: 24px; width: 24px;"
167
+ indeterminate
168
+ {...prefixFilter(restProps, 'progress$')}
169
+ />
170
+ </div>
171
+ {/if}
172
+ </form>
161
173
  </Content>
162
174
  <Actions>
163
175
  <Button disabled={loading} {...prefixFilter(restProps, 'closeButton$')}>
@@ -183,52 +195,54 @@
183
195
  </Actions>
184
196
  {:else if hasTOTPSecret === true}
185
197
  <Content id="tilmeld-two-factor-content">
186
- <p>
187
- 2 Factor Authentication (2FA) is enabled on your account. If you'd
188
- like to disable it, you can provide your password and a code generated
189
- by your Authenticator app. You can re-enable it by generating a new QR
190
- code at any time.
191
- </p>
192
-
193
- <div>
194
- <Textfield
195
- bind:value={password}
196
- label="Password"
197
- type="password"
198
- style="width: 100%;"
199
- input$autocomplete="current-password"
200
- {...prefixFilter(restProps, 'password$')}
201
- />
202
- </div>
203
-
204
- <div>
205
- <Textfield
206
- bind:value={code}
207
- label="2FA Code"
208
- style="width: 100%;"
209
- input$maxlength={6}
210
- input$minlength={6}
211
- {...prefixFilter(restProps, 'code$')}
212
- />
213
- </div>
214
-
215
- {@render additional?.()}
216
-
217
- {#if failureMessage}
218
- <div class="tilmeld-two-factor-failure">
219
- {failureMessage}
198
+ <form onsubmit={preventDefault(stopPropagation(disableTOTP))}>
199
+ <p>
200
+ 2 Factor Authentication (2FA) is enabled on your account. If you'd
201
+ like to disable it, you can provide your password and a code
202
+ generated by your Authenticator app. You can re-enable it by
203
+ generating a new QR code at any time.
204
+ </p>
205
+
206
+ <div>
207
+ <Textfield
208
+ bind:value={password}
209
+ label="Password"
210
+ type="password"
211
+ style="width: 100%;"
212
+ input$autocomplete="current-password"
213
+ {...prefixFilter(restProps, 'password$')}
214
+ />
220
215
  </div>
221
- {/if}
222
216
 
223
- {#if loading}
224
- <div class="tilmeld-two-factor-loading">
225
- <CircularProgress
226
- style="height: 24px; width: 24px;"
227
- indeterminate
228
- {...prefixFilter(restProps, 'progress$')}
217
+ <div>
218
+ <Textfield
219
+ bind:value={code}
220
+ label="2FA Code"
221
+ style="width: 100%;"
222
+ input$maxlength={6}
223
+ input$minlength={6}
224
+ {...prefixFilter(restProps, 'code$')}
229
225
  />
230
226
  </div>
231
- {/if}
227
+
228
+ {@render additional?.()}
229
+
230
+ {#if failureMessage}
231
+ <div class="tilmeld-two-factor-failure">
232
+ {failureMessage}
233
+ </div>
234
+ {/if}
235
+
236
+ {#if loading}
237
+ <div class="tilmeld-two-factor-loading">
238
+ <CircularProgress
239
+ style="height: 24px; width: 24px;"
240
+ indeterminate
241
+ {...prefixFilter(restProps, 'progress$')}
242
+ />
243
+ </div>
244
+ {/if}
245
+ </form>
232
246
  </Content>
233
247
  <Actions>
234
248
  <Button disabled={loading} {...prefixFilter(restProps, 'closeButton$')}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nymphjs/tilmeld-components",
3
- "version": "1.0.0-beta.135",
3
+ "version": "1.0.0-beta.136",
4
4
  "description": "Nymph.js - Tilmeld Front End Components",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "license": "Apache-2.0",
52
52
  "devDependencies": {
53
- "@nymphjs/tilmeld-client": "^1.0.0-beta.135",
53
+ "@nymphjs/tilmeld-client": "^1.0.0-beta.136",
54
54
  "@smui/button": "^9.0.2",
55
55
  "@smui/checkbox": "^9.0.2",
56
56
  "@smui/circular-progress": "^9.0.2",
@@ -72,5 +72,5 @@
72
72
  "webpack": "^5.109.2",
73
73
  "webpack-cli": "^7.2.2"
74
74
  },
75
- "gitHead": "ee05b44026f1408b76aaf56afb5b7172ee745632"
75
+ "gitHead": "968fecb6ad8ad1d560191e58b671057f911133c9"
76
76
  }