@@ -7,31 +7,100 @@ Sandstorm.NeosTwoFactorAuthentication.BackendController.new = Sandstorm.NeosTwoF
77
88 content = Neos.Fusion:Component {
99 renderer = afx`
10- <Neos.Fusion.Form:Form form.target.action="create">
11- <Neos.Fusion.Form:Hidden field.name="secret" field.value={secret}/>
12-
13- <div class="neos-control-group">
14- <img src={qrCode} style="width: 100%; max-width: 400px"/>
15- </div>
16-
17- <div class="neos-control-group">
18- <Neos.Fusion.Form:Input
19- field.name="secondFactorFromApp"
20- attributes.required="required"
21- attributes.id="secondFactorFromApp"
22- attributes.placeholder={I18n.id('otp-placeholder').package('Sandstorm.NeosTwoFactorAuthentication')}
23- attributes.class="neos-span5"
24- attributes.aria-label={I18n.id('otp-placeholder').package('Sandstorm.NeosTwoFactorAuthentication')}
25- attributes.autocomplete="off"
26- />
27- </div>
28-
29- <div class="neos-control-group">
30- <Neos.Fusion.Form:Button>
31- {I18n.id('module.new.submit-otp').package('Sandstorm.NeosTwoFactorAuthentication').source('Backend').translate()}
32- </Neos.Fusion.Form:Button>
33- </div>
34- </Neos.Fusion.Form:Form>
10+ <Neos.Fusion.Form:Form form.target.action="create">
11+ <div class="neos-control-group">
12+ <img src={qrCode} style="width: 100%; max-width: 400px"/>
13+ </div>
14+
15+ <div class="neos-control-group neos-two-factor__secret-wrapper">
16+ <Neos.Fusion.Form:Hidden attributes.id="secret" field.name="secret" field.value={secret}/>
17+
18+ <div class="neos-actions">
19+ <button type="button" class="neos-button neos-login-btn neos-two-factor__secret__show__button">
20+ {I18n.id('form.secret.show').package('Sandstorm.NeosTwoFactorAuthentication')}
21+ </button>
22+ </div>
23+
24+ <dialog>
25+ <div>
26+ <div class="neos-two-factor__secret">
27+ <p>
28+ {
29+ Array.join(
30+ Array.map(
31+ String.split(secret, ''),
32+ char => Type.isNumeric(char) ? '<span class="neos-two-factor__secret__number">' + char + '</span>' : '<span>' + char + '</span>'
33+ ),
34+ ''
35+ )
36+ }
37+ </p>
38+
39+ <div class="neos-two-factor__secret__overflow-indicator--left" aria-hidden="true">
40+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
41+ <!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
42+ <path d="M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"/>
43+ </svg>
44+ </div>
45+ <div class="neos-two-factor__secret__overflow-indicator--right" aria-hidden="true">
46+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
47+ <!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
48+ <path d="M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/>
49+ </svg>
50+ </div>
51+ </div>
52+
53+ <div class="neos-two-factor__dialog__actions neos-actions">
54+ <button type="button" class="neos-two-factor__secret__copy__button neos-button neos-login-btn">
55+ <span class="neos-two-factor__secret__copy__button__icon">
56+ <i>
57+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
58+ <!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
59+ <path d="M280 64l40 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l40 0 9.6 0C121 27.5 153.3 0 192 0s71 27.5 78.4 64l9.6 0zM64 112c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16l-16 0 0 24c0 13.3-10.7 24-24 24l-88 0-88 0c-13.3 0-24-10.7-24-24l0-24-16 0zm128-8a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"/>
60+ </svg>
61+ </i>
62+ </span>
63+ <span class="neos-two-factor__secret__copy__button__icon neos-two-factor__hidden">
64+ <i>
65+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
66+ <!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
67+ <path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/>
68+ </svg>
69+ </i>
70+ </span>
71+ {I18n.id('form.secret.copy').package('Sandstorm.NeosTwoFactorAuthentication')}
72+ </button>
73+ <button type="button" class="neos-two-factor__secret__close__button neos-button neos-login-btn">
74+ {I18n.id('form.secret.close').package('Sandstorm.NeosTwoFactorAuthentication')}
75+ </button>
76+ </div>
77+ </div>
78+ </dialog>
79+ </div>
80+
81+ <div class="neos-control-group">
82+ <Neos.Fusion.Form:Input
83+ field.name="secondFactorFromApp"
84+ attributes.required="required"
85+ attributes.id="secondFactorFromApp"
86+ attributes.placeholder={I18n.id('otp-placeholder').package('Sandstorm.NeosTwoFactorAuthentication')}
87+ attributes.aria-label={I18n.id('otp-placeholder').package('Sandstorm.NeosTwoFactorAuthentication')}
88+ attributes.autocomplete="off"
89+ />
90+ </div>
91+
92+ <div class="neos-control-group">
93+ <Neos.Fusion.Form:Button>
94+ {I18n.id('module.new.submit-otp').package('Sandstorm.NeosTwoFactorAuthentication').source('Backend').translate()}
95+ </Neos.Fusion.Form:Button>
96+ </div>
97+ </Neos.Fusion.Form:Form>
98+
99+ <Neos.Fusion:Loop items={props.scripts}>
100+ <script @children="attributes.src">
101+ <Neos.Fusion:ResourceUri path={item}/>
102+ </script>
103+ </Neos.Fusion:Loop>
35104 `
36105 }
37106 }
0 commit comments