@keycloakify/angular 0.0.11 → 0.1.1

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 (61) hide show
  1. package/bin/108.index.js +242 -0
  2. package/bin/338.index.js +104 -54
  3. package/bin/402.index.js +1250 -0
  4. package/bin/758.index.js +777 -53
  5. package/bin/{925.index.js → 84.index.js} +124 -624
  6. package/bin/main.js +59 -4
  7. package/package.json +1 -1
  8. package/src/bin/add-story.ts +126 -0
  9. package/src/bin/eject-page.ts +49 -11
  10. package/src/bin/initialize-account-theme/boilerplate/KcContextMock.ts +47 -1
  11. package/src/bin/main.ts +2 -4
  12. package/src/bin/tools/nodeModulesBinDirPath.ts +38 -0
  13. package/src/bin/tools/runPrettier.ts +89 -0
  14. package/src/bin/tools/transformCodebase_async.ts +89 -0
  15. package/src/bin/update-kc-gen.ts +20 -15
  16. package/stories/account/pages/account.stories.ts +133 -0
  17. package/stories/account/pages/applications.stories.ts +196 -0
  18. package/stories/account/pages/federated-identity.stories.ts +78 -0
  19. package/stories/account/pages/log.stories.ts +147 -0
  20. package/stories/account/pages/password.stories.ts +104 -0
  21. package/stories/account/pages/sessions.stories.ts +143 -0
  22. package/stories/account/pages/totp.stories.ts +100 -0
  23. package/stories/login/pages/code.stories.ts +51 -0
  24. package/stories/login/pages/delete-account-confirm.stories.ts +43 -0
  25. package/stories/login/pages/delete-credential.stories.ts +56 -0
  26. package/stories/login/pages/error.stories.ts +56 -0
  27. package/stories/login/pages/frontchannel-logout.stories.ts +26 -0
  28. package/stories/login/pages/idp-review-user-profile.stories.ts +60 -0
  29. package/stories/login/pages/info.stories.ts +94 -0
  30. package/stories/login/pages/login-config-totp.stories.ts +57 -0
  31. package/stories/login/pages/login-device-verify-user-code.stories.ts +14 -0
  32. package/stories/login/pages/login-idp-link-confirm-override.stories.ts +17 -0
  33. package/stories/login/pages/login-idp-link-confirm.stories.ts +103 -0
  34. package/stories/login/pages/login-idp-link-email.stories.ts +102 -0
  35. package/stories/login/pages/login-oauth-grant.stories.ts +68 -0
  36. package/stories/login/pages/login-oauth2-device-verify-user-code.stories.ts +15 -0
  37. package/stories/login/pages/login-otp.stories.ts +94 -0
  38. package/stories/login/pages/login-page-expired.stories.ts +31 -0
  39. package/stories/login/pages/login-passkeys-conditional-authenticate.stories.ts +16 -0
  40. package/stories/login/pages/login-password.stories.ts +52 -0
  41. package/stories/login/pages/login-recovery-authn-code-config.stories.ts +31 -0
  42. package/stories/login/pages/login-recovery-authn-code-input.stories.ts +16 -0
  43. package/stories/login/pages/login-reset-otp.stories.ts +71 -0
  44. package/stories/login/pages/login-reset-password.stories.ts +50 -0
  45. package/stories/login/pages/login-update-password.stories.ts +46 -0
  46. package/stories/login/pages/login-update-profile.stories.ts +31 -0
  47. package/stories/login/pages/login-username.stories.ts +28 -0
  48. package/stories/login/pages/login-verify-email.stories.ts +98 -0
  49. package/stories/login/pages/login-x509-info.stories.ts +40 -0
  50. package/stories/login/pages/login.stories.ts +260 -0
  51. package/stories/login/pages/logout-confirm.stories.ts +44 -0
  52. package/stories/login/pages/register.stories.ts +230 -0
  53. package/stories/login/pages/saml-post-form.stories.ts +17 -0
  54. package/stories/login/pages/select-authenticator.stories.ts +95 -0
  55. package/stories/login/pages/terms.stories.ts +79 -0
  56. package/stories/login/pages/update-email.stories.ts +31 -0
  57. package/stories/login/pages/webauthn-authenticate.stories.ts +126 -0
  58. package/stories/login/pages/webauthn-error.stories.ts +62 -0
  59. package/stories/login/pages/webauthn-register.stories.ts +46 -0
  60. package/src/bin/tools/runFormat.ts +0 -71
  61. package/src/stories/login/pages/login/login.stories.ts +0 -146
@@ -0,0 +1,230 @@
1
+ import { Meta, StoryObj } from '@storybook/angular';
2
+ import { decorators, KcPageStory } from '../KcPageStory';
3
+ import { Attribute } from 'keycloakify/login';
4
+
5
+ const meta: Meta<KcPageStory> = {
6
+ title: 'login/register.ftl',
7
+ component: KcPageStory,
8
+ decorators: decorators,
9
+ globals: {
10
+ pageId: 'register.ftl'
11
+ }
12
+ };
13
+
14
+ export default meta;
15
+
16
+ type Story = StoryObj<KcPageStory>;
17
+
18
+ export const Default: Story = {};
19
+
20
+ export const WithEmailAlreadyExists: Story = {
21
+ globals: {
22
+ overrides: {
23
+ messagesPerField: {
24
+ existsError: (fieldName: string, ...otherFieldNames: string[]) =>
25
+ [fieldName, ...otherFieldNames].includes('email'),
26
+ get: (fieldName: string) =>
27
+ fieldName === 'email' ? 'Email already exists.' : ''
28
+ }
29
+ }
30
+ }
31
+ };
32
+
33
+ export const WithRestrictedToMITStudents: Story = {
34
+ globals: {
35
+ overrides: {
36
+ 'x-keycloakify': {
37
+ messages: {
38
+ 'profile.attributes.email.inputHelperTextBefore':
39
+ 'Please use your MIT or Berkeley email.',
40
+ 'profile.attributes.email.pattern.error':
41
+ 'This is not an MIT (<strong>@mit.edu</strong>) nor a Berkeley (<strong>@berkeley.edu</strong>) email.'
42
+ }
43
+ }
44
+ }
45
+ }
46
+ };
47
+
48
+ export const WithFavoritePet: Story = {
49
+ globals: {
50
+ overrides: {
51
+ profile: {
52
+ attributesByName: {
53
+ favoritePet: {
54
+ name: 'favorite-pet',
55
+ displayName: '${profile.attributes.favoritePet}',
56
+ validators: {
57
+ options: {
58
+ options: ['cat', 'dog', 'fish']
59
+ }
60
+ },
61
+ annotations: {
62
+ inputOptionLabelsI18nPrefix:
63
+ 'profile.attributes.favoritePet.options'
64
+ },
65
+ required: false,
66
+ readOnly: false
67
+ } satisfies Attribute
68
+ }
69
+ },
70
+ 'x-keycloakify': {
71
+ messages: {
72
+ 'profile.attributes.favoritePet': 'Favorite Pet',
73
+ 'profile.attributes.favoritePet.options.cat': 'Fluffy Cat',
74
+ 'profile.attributes.favoritePet.options.dog': 'Loyal Dog',
75
+ 'profile.attributes.favoritePet.options.fish': 'Peaceful Fish'
76
+ }
77
+ }
78
+ }
79
+ }
80
+ };
81
+
82
+ export const WithNewsletter: Story = {
83
+ globals: {
84
+ overrides: {
85
+ profile: {
86
+ attributesByName: {
87
+ newsletter: {
88
+ name: 'newsletter',
89
+ displayName: 'Sign up to the newsletter',
90
+ validators: {
91
+ options: {
92
+ options: ['yes']
93
+ }
94
+ },
95
+ annotations: {
96
+ inputOptionLabels: {
97
+ yes: 'I want my email inbox filled with spam'
98
+ },
99
+ inputType: 'multiselect-checkboxes'
100
+ },
101
+ required: false,
102
+ readOnly: false
103
+ } satisfies Attribute
104
+ }
105
+ }
106
+ }
107
+ }
108
+ };
109
+
110
+ export const WithEmailAsUsername: Story = {
111
+ globals: {
112
+ overrides: {
113
+ realm: {
114
+ registrationEmailAsUsername: true
115
+ },
116
+ profile: {
117
+ attributesByName: {
118
+ username: undefined
119
+ }
120
+ }
121
+ }
122
+ }
123
+ };
124
+
125
+ export const WithRecaptcha: Story = {
126
+ globals: {
127
+ overrides: {
128
+ scripts: ['https://www.google.com/recaptcha/api.js?hl=en'],
129
+ recaptchaRequired: true,
130
+ recaptchaSiteKey: '6LfQHvApAAAAAE73SYTd5vS0lB1Xr7zdiQ-6iBVa'
131
+ }
132
+ }
133
+ };
134
+
135
+ export const WithRecaptchaFrench: Story = {
136
+ globals: {
137
+ overrides: {
138
+ locale: {
139
+ currentLanguageTag: 'fr'
140
+ },
141
+ scripts: ['https://www.google.com/recaptcha/api.js?hl=fr'],
142
+ recaptchaRequired: true,
143
+ recaptchaSiteKey: '6LfQHvApAAAAAE73SYTd5vS0lB1Xr7zdiQ-6iBVa'
144
+ }
145
+ }
146
+ };
147
+
148
+ export const WithPasswordMinLength8: Story = {
149
+ globals: {
150
+ overrides: {
151
+ passwordPolicies: {
152
+ length: 8
153
+ }
154
+ }
155
+ }
156
+ };
157
+
158
+ export const WithTermsAcceptance: Story = {
159
+ globals: {
160
+ overrides: {
161
+ termsAcceptanceRequired: true,
162
+ 'x-keycloakify': {
163
+ messages: {
164
+ termsText:
165
+ "<a href='https://example.com/terms'>Service Terms of Use</a>"
166
+ }
167
+ }
168
+ }
169
+ }
170
+ };
171
+
172
+ export const WithTermsNotAccepted: Story = {
173
+ globals: {
174
+ overrides: {
175
+ termsAcceptanceRequired: true,
176
+ messagesPerField: {
177
+ existsError: (fieldName: string) => fieldName === 'termsAccepted',
178
+ get: (fieldName: string) =>
179
+ fieldName === 'termsAccepted' ? 'You must accept the terms.' : ''
180
+ }
181
+ }
182
+ }
183
+ };
184
+
185
+ export const WithFieldErrors: Story = {
186
+ globals: {
187
+ overrides: {
188
+ profile: {
189
+ attributesByName: {
190
+ username: { value: '' },
191
+ email: { value: 'invalid-email' }
192
+ }
193
+ },
194
+ messagesPerField: {
195
+ existsError: (fieldName: string) =>
196
+ ['username', 'email'].includes(fieldName),
197
+ get: (fieldName: string) => {
198
+ if (fieldName === 'username') return 'Username is required.';
199
+ if (fieldName === 'email') return 'Invalid email format.';
200
+ return '';
201
+ }
202
+ }
203
+ }
204
+ }
205
+ };
206
+
207
+ export const WithReadOnlyFields: Story = {
208
+ globals: {
209
+ overrides: {
210
+ profile: {
211
+ attributesByName: {
212
+ username: { value: 'johndoe', readOnly: true },
213
+ email: { value: 'jhon.doe@gmail.com', readOnly: false }
214
+ }
215
+ }
216
+ }
217
+ }
218
+ };
219
+
220
+ export const WithAutoGeneratedUsername: Story = {
221
+ globals: {
222
+ overrides: {
223
+ profile: {
224
+ attributesByName: {
225
+ username: { value: 'autogenerated_username' }
226
+ }
227
+ }
228
+ }
229
+ }
230
+ };
@@ -0,0 +1,17 @@
1
+ import { Meta, StoryObj } from '@storybook/angular';
2
+ import { decorators, KcPageStory } from '../KcPageStory';
3
+
4
+ const meta: Meta<KcPageStory> = {
5
+ title: 'login/saml-post-form.ftl',
6
+ component: KcPageStory,
7
+ decorators: decorators,
8
+ globals: {
9
+ pageId: 'saml-post-form.ftl'
10
+ }
11
+ };
12
+
13
+ export default meta;
14
+
15
+ type Story = StoryObj<KcPageStory>;
16
+
17
+ export const Default: Story = {};
@@ -0,0 +1,95 @@
1
+ import { Meta, StoryObj } from '@storybook/angular';
2
+ import { decorators, KcPageStory } from '../KcPageStory';
3
+
4
+ const meta: Meta<KcPageStory> = {
5
+ title: 'login/select-authenticator.ftl',
6
+ component: KcPageStory,
7
+ decorators: decorators,
8
+ globals: {
9
+ pageId: 'select-authenticator.ftl'
10
+ }
11
+ };
12
+
13
+ export default meta;
14
+
15
+ type Story = StoryObj<KcPageStory>;
16
+
17
+ export const Default: Story = {};
18
+
19
+ export const WithDifferentAuthenticationMethods: Story = {
20
+ globals: {
21
+ overrides: {
22
+ auth: {
23
+ authenticationSelections: [
24
+ {
25
+ authExecId: '25697c4e-0c80-4f2c-8eb7-2c16347e8e8d',
26
+ displayName: 'auth-username-password-form-display-name',
27
+ helpText: 'auth-username-password-form-help-text',
28
+ iconCssClass: 'kcAuthenticatorPasswordClass'
29
+ },
30
+ {
31
+ authExecId: '4cb60872-ce0d-4c8f-a806-e651ed77994b',
32
+ displayName: 'webauthn-passwordless-display-name',
33
+ helpText: 'webauthn-passwordless-help-text',
34
+ iconCssClass: 'kcAuthenticatorWebAuthnPasswordlessClass'
35
+ }
36
+ ]
37
+ }
38
+ }
39
+ }
40
+ };
41
+
42
+ export const WithRealmTranslations: Story = {
43
+ globals: {
44
+ overrides: {
45
+ auth: {
46
+ authenticationSelections: [
47
+ {
48
+ authExecId: 'f0c22855-eda7-4092-8565-0c22f77d2ffb',
49
+ displayName: 'home-idp-discovery-display-name',
50
+ helpText: 'home-idp-discovery-help-text',
51
+ iconCssClass: 'kcAuthenticatorDefaultClass'
52
+ },
53
+ {
54
+ authExecId: '20456f5a-8b2b-45f3-98e0-551dcb27e3e1',
55
+ displayName: 'identity-provider-redirctor-display-name',
56
+ helpText: 'identity-provider-redirctor-help-text',
57
+ iconCssClass: 'kcAuthenticatorDefaultClass'
58
+ },
59
+ {
60
+ authExecId: 'eb435db9-474e-473a-8da7-c184fa510b96',
61
+ displayName: 'auth-username-password-form-display-name',
62
+ helpText: 'auth-username-password-help-text',
63
+ iconCssClass: 'kcAuthenticatorDefaultClass'
64
+ }
65
+ ]
66
+ },
67
+ 'x-keycloakify': {
68
+ messages: {
69
+ 'home-idp-discovery-display-name': 'Home identity provider',
70
+ 'home-idp-discovery-help-text':
71
+ 'Sign in via your home identity provider which will be automatically determined based on your provided email address.',
72
+ 'identity-provider-redirctor-display-name':
73
+ 'Identity Provider Redirector',
74
+ 'identity-provider-redirctor-help-text':
75
+ 'Sign in via your identity provider.',
76
+ 'auth-username-password-help-text':
77
+ 'Sign in via your username and password.'
78
+ }
79
+ }
80
+ }
81
+ }
82
+ };
83
+
84
+ export const WithoutAuthenticationSelections: Story = {
85
+ globals: {
86
+ overrides: {
87
+ url: {
88
+ loginAction: '/mock-login-action'
89
+ },
90
+ auth: {
91
+ authenticationSelections: []
92
+ }
93
+ }
94
+ }
95
+ };
@@ -0,0 +1,79 @@
1
+ import { Meta, StoryObj } from '@storybook/angular';
2
+ import { decorators, KcPageStory } from '../KcPageStory';
3
+
4
+ const meta: Meta<KcPageStory> = {
5
+ title: 'login/terms.ftl',
6
+ component: KcPageStory,
7
+ decorators: decorators,
8
+ globals: {
9
+ pageId: 'terms.ftl'
10
+ }
11
+ };
12
+
13
+ export default meta;
14
+
15
+ type Story = StoryObj<KcPageStory>;
16
+
17
+ export const Default: Story = {
18
+ globals: {
19
+ overrides: {
20
+ 'x-keycloakify': {
21
+ messages: {
22
+ termsText: '<p>My terms in <strong>English</strong></p>'
23
+ }
24
+ }
25
+ }
26
+ }
27
+ };
28
+
29
+ export const French: Story = {
30
+ globals: {
31
+ overrides: {
32
+ locale: {
33
+ currentLanguageTag: 'fr'
34
+ },
35
+ 'x-keycloakify': {
36
+ messages: {
37
+ termsText: '<p>Mes terme en <strong>Français</strong></p>'
38
+ }
39
+ }
40
+ }
41
+ }
42
+ };
43
+
44
+ export const Spanish: Story = {
45
+ globals: {
46
+ overrides: {
47
+ locale: {
48
+ currentLanguageTag: 'es'
49
+ },
50
+ 'x-keycloakify': {
51
+ messages: {
52
+ termsText: '<p>Mis términos en <strong>Español</strong></p>'
53
+ }
54
+ }
55
+ }
56
+ }
57
+ };
58
+
59
+ export const LongMessage: Story = {
60
+ globals: {
61
+ overrides: {
62
+ 'x-keycloakify': {
63
+ messages: {
64
+ termsText: `
65
+ <p>These are the terms and conditions. Please read them carefully.</p>
66
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia odio vitae vestibulum vestibulum.</p>
67
+ <p>Cras vehicula diam vel metus faucibus, at scelerisque lacus pretium. Donec ac consectetur justo. Morbi in sollicitudin nulla.</p>
68
+ <p>Suspendisse potenti. Phasellus pharetra consequat ante, at dictum ligula volutpat a. Quisque ultricies velit nec nulla gravida accumsan.</p>
69
+ <p>Curabitur tristique, magna id hendrerit tristique, enim nunc laoreet erat, non accumsan lacus arcu et nulla.</p>
70
+ <p>Fusce feugiat nisi orci, in placerat dui luctus ut. Suspendisse in velit eu urna auctor consequat a euismod enim.</p>
71
+ <p>Etiam et massa a sapien pharetra mollis. In lacinia quam id libero tincidunt, at egestas felis viverra.</p>
72
+ <p>Nunc pulvinar imperdiet facilisis. Curabitur ultricies dictum lectus, nec consectetur metus fringilla id.</p>
73
+ <p><strong>Please accept the terms to proceed.</strong></p>
74
+ `
75
+ }
76
+ }
77
+ }
78
+ }
79
+ };
@@ -0,0 +1,31 @@
1
+ import { Meta, StoryObj } from '@storybook/angular';
2
+ import { decorators, KcPageStory } from '../KcPageStory';
3
+
4
+ const meta: Meta<KcPageStory> = {
5
+ title: 'login/update-email.ftl',
6
+ component: KcPageStory,
7
+ decorators: decorators,
8
+ globals: {
9
+ pageId: 'update-email.ftl'
10
+ }
11
+ };
12
+
13
+ export default meta;
14
+
15
+ type Story = StoryObj<KcPageStory>;
16
+
17
+ export const Default: Story = {};
18
+
19
+ export const WithAppInitiatedAction: Story = {
20
+ globals: {
21
+ overrides: {
22
+ url: {
23
+ loginAction: '/mock-login-action'
24
+ },
25
+ messagesPerField: {
26
+ exists: () => false
27
+ },
28
+ isAppInitiatedAction: true
29
+ }
30
+ }
31
+ };
@@ -0,0 +1,126 @@
1
+ import { Meta, StoryObj } from '@storybook/angular';
2
+ import { decorators, KcPageStory } from '../KcPageStory';
3
+
4
+ const meta: Meta<KcPageStory> = {
5
+ title: 'login/webauthn-authenticate.ftl',
6
+ component: KcPageStory,
7
+ decorators: decorators,
8
+ globals: {
9
+ pageId: 'webauthn-authenticate.ftl'
10
+ }
11
+ };
12
+
13
+ export default meta;
14
+
15
+ type Story = StoryObj<KcPageStory>;
16
+
17
+ export const Default: Story = {};
18
+
19
+ export const WithMultipleAuthenticators: Story = {
20
+ globals: {
21
+ overrides: {
22
+ url: {
23
+ loginAction: '/mock-login-action'
24
+ },
25
+ authenticators: {
26
+ authenticators: [
27
+ {
28
+ credentialId: 'authenticator-1',
29
+ label: 'Security Key 1',
30
+ transports: {
31
+ iconClass: 'kcAuthenticatorUsbIcon',
32
+ displayNameProperties: ['USB']
33
+ },
34
+ createdAt: '2023-01-01'
35
+ },
36
+ {
37
+ credentialId: 'authenticator-2',
38
+ label: 'Security Key 2',
39
+ transports: {
40
+ iconClass: 'kcAuthenticatorNfcIcon',
41
+ displayNameProperties: ['NFC']
42
+ },
43
+ createdAt: '2023-02-01'
44
+ }
45
+ ]
46
+ },
47
+ shouldDisplayAuthenticators: true
48
+ }
49
+ }
50
+ };
51
+
52
+ export const WithSingleAuthenticator: Story = {
53
+ globals: {
54
+ overrides: {
55
+ url: {
56
+ loginAction: '/mock-login-action'
57
+ },
58
+ authenticators: {
59
+ authenticators: [
60
+ {
61
+ credentialId: 'authenticator-1',
62
+ label: 'My Security Key',
63
+ transports: {
64
+ iconClass: 'kcAuthenticatorUsbIcon',
65
+ displayNameProperties: ['USB']
66
+ },
67
+ createdAt: '2023-01-01'
68
+ }
69
+ ]
70
+ },
71
+ shouldDisplayAuthenticators: true
72
+ }
73
+ }
74
+ };
75
+
76
+ export const WithErrorDuringAuthentication: Story = {
77
+ globals: {
78
+ overrides: {
79
+ url: {
80
+ loginAction: '/mock-login-action'
81
+ },
82
+ authenticators: {
83
+ authenticators: [
84
+ {
85
+ credentialId: 'authenticator-1',
86
+ label: 'My Security Key',
87
+ transports: {
88
+ iconClass: 'kcAuthenticatorUsbIcon',
89
+ displayNameProperties: ['USB']
90
+ },
91
+ createdAt: '2023-01-01'
92
+ }
93
+ ]
94
+ },
95
+ shouldDisplayAuthenticators: true,
96
+ message: {
97
+ summary: 'An error occurred during WebAuthn authentication.',
98
+ type: 'error'
99
+ }
100
+ }
101
+ }
102
+ };
103
+
104
+ export const WithJavaScriptDisabled: Story = {
105
+ globals: {
106
+ overrides: {
107
+ url: {
108
+ loginAction: '/mock-login-action'
109
+ },
110
+ authenticators: {
111
+ authenticators: [
112
+ {
113
+ credentialId: 'authenticator-1',
114
+ label: 'My Security Key',
115
+ transports: {
116
+ iconClass: 'kcAuthenticatorUsbIcon',
117
+ displayNameProperties: ['USB']
118
+ },
119
+ createdAt: '2023-01-01'
120
+ }
121
+ ]
122
+ },
123
+ shouldDisplayAuthenticators: true
124
+ }
125
+ }
126
+ };
@@ -0,0 +1,62 @@
1
+ import { Meta, StoryObj } from '@storybook/angular';
2
+ import { decorators, KcPageStory } from '../KcPageStory';
3
+
4
+ const meta: Meta<KcPageStory> = {
5
+ title: 'login/webauthn-error.ftl',
6
+ component: KcPageStory,
7
+ decorators: decorators,
8
+ globals: {
9
+ pageId: 'webauthn-error.ftl'
10
+ }
11
+ };
12
+
13
+ export default meta;
14
+
15
+ type Story = StoryObj<KcPageStory>;
16
+
17
+ export const Default: Story = {};
18
+
19
+ export const WithRetryAvailable: Story = {
20
+ globals: {
21
+ overrides: {
22
+ url: {
23
+ loginAction: '/mock-login-action'
24
+ },
25
+ isAppInitiatedAction: false,
26
+ message: {
27
+ summary: 'WebAuthn authentication failed. Please try again.',
28
+ type: 'error'
29
+ }
30
+ }
31
+ }
32
+ };
33
+
34
+ export const WithAppInitiatedAction: Story = {
35
+ globals: {
36
+ overrides: {
37
+ url: {
38
+ loginAction: '/mock-login-action'
39
+ },
40
+ isAppInitiatedAction: true,
41
+ message: {
42
+ summary: 'WebAuthn authentication failed. You can try again or cancel.',
43
+ type: 'error'
44
+ }
45
+ }
46
+ }
47
+ };
48
+
49
+ export const WithJavaScriptDisabled: Story = {
50
+ globals: {
51
+ overrides: {
52
+ url: {
53
+ loginAction: '/mock-login-action'
54
+ },
55
+ isAppInitiatedAction: false,
56
+ message: {
57
+ summary: 'JavaScript is disabled or not working. Please retry manually.',
58
+ type: 'warning'
59
+ }
60
+ }
61
+ }
62
+ };
@@ -0,0 +1,46 @@
1
+ import { Meta, StoryObj } from '@storybook/angular';
2
+ import { decorators, KcPageStory } from '../KcPageStory';
3
+
4
+ const meta: Meta<KcPageStory> = {
5
+ title: 'login/webauthn-register.ftl',
6
+ component: KcPageStory,
7
+ decorators: decorators,
8
+ globals: {
9
+ pageId: 'webauthn-register.ftl'
10
+ }
11
+ };
12
+
13
+ export default meta;
14
+
15
+ type Story = StoryObj<KcPageStory>;
16
+
17
+ export const Default: Story = {};
18
+
19
+ export const WithRetryAvailable: Story = {
20
+ globals: {
21
+ overrides: {
22
+ url: {
23
+ loginAction: '/mock-login-action'
24
+ },
25
+ isSetRetry: true,
26
+ isAppInitiatedAction: false
27
+ }
28
+ }
29
+ };
30
+
31
+ export const WithErrorDuringRegistration: Story = {
32
+ globals: {
33
+ overrides: {
34
+ url: {
35
+ loginAction: '/mock-login-action'
36
+ },
37
+ isSetRetry: false,
38
+ isAppInitiatedAction: false,
39
+ message: {
40
+ summary:
41
+ 'An error occurred during WebAuthn registration. Please try again.',
42
+ type: 'error'
43
+ }
44
+ }
45
+ }
46
+ };