diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-01-18 22:46:44 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-01-23 13:28:24 +0100 |
commit | a0c5eb003f1cbeef10d5620e98870c7556e17c75 (patch) | |
tree | 52660ffe507ac294db3db387842eed43fad1c75a /src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig | |
parent | 4c0e747940ac39630f1d2a6a14c628ba6729ecfd (diff) | |
download | wallabag-a0c5eb003f1cbeef10d5620e98870c7556e17c75.tar.gz wallabag-a0c5eb003f1cbeef10d5620e98870c7556e17c75.tar.zst wallabag-a0c5eb003f1cbeef10d5620e98870c7556e17c75.zip |
Change the way to enable 2FA
And add a step to validate a generated code from the OTP app
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig')
-rw-r--r-- | src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig | 65 |
1 files changed, 30 insertions, 35 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig index 5b00eb7b..412c18f4 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig | |||
@@ -196,45 +196,40 @@ | |||
196 | </div> | 196 | </div> |
197 | </div> | 197 | </div> |
198 | 198 | ||
199 | {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} | ||
200 | |||
199 | {% if twofactor_auth %} | 201 | {% if twofactor_auth %} |
202 | <br/> | ||
203 | <br/> | ||
200 | <div class="row"> | 204 | <div class="row"> |
201 | {{ 'config.form_user.two_factor_description'|trans }} | 205 | <h5>{{ 'config.otp.page_title'|trans }}</h5> |
202 | 206 | ||
203 | <div class="input-field col s11"> | 207 | <p>{{ 'config.form_user.two_factor_description'|trans }}</p> |
204 | {{ form_widget(form.user.emailTwoFactor) }} | 208 | |
205 | {{ form_label(form.user.emailTwoFactor) }} | 209 | <table> |
206 | {{ form_errors(form.user.emailTwoFactor) }} | 210 | <thead> |
207 | </div> | 211 | <tr> |
208 | <div class="input-field col s11"> | 212 | <th>{{ 'config.form_user.two_factor.table_method'|trans }}</th> |
209 | {{ form_widget(form.user.googleTwoFactor) }} | 213 | <th>{{ 'config.form_user.two_factor.table_state'|trans }}</th> |
210 | {{ form_label(form.user.googleTwoFactor) }} | 214 | <th>{{ 'config.form_user.two_factor.table_action'|trans }}</th> |
211 | {{ form_errors(form.user.googleTwoFactor) }} | 215 | </tr> |
212 | </div> | 216 | </thead> |
217 | |||
218 | <tbody> | ||
219 | <tr> | ||
220 | <td>{{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}</td> | ||
221 | <td>{% if app.user.isEmailTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td> | ||
222 | <td><a href="{{ path('config_otp_email') }}" class="waves-effect waves-light btn{% if app.user.isEmailTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_email'|trans }}</a></td> | ||
223 | </tr> | ||
224 | <tr> | ||
225 | <td>{{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}</td> | ||
226 | <td>{% if app.user.isGoogleTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td> | ||
227 | <td><a href="{{ path('config_otp_app') }}" class="waves-effect waves-light btn{% if app.user.isGoogleTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_app'|trans }}</a></td> | ||
228 | </tr> | ||
229 | </tbody> | ||
230 | </table> | ||
213 | </div> | 231 | </div> |
214 | |||
215 | {% for OtpQrCode in app.session.flashbag.get('OtpQrCode') %} | ||
216 | <div class="card-panel yellow darken-1 black-text"> | ||
217 | {{ 'config.form_user.two_factor_code_description_1'|trans }} | ||
218 | <br/> | ||
219 | {{ 'config.form_user.two_factor_code_description_2'|trans }} | ||
220 | <br/><br/> | ||
221 | <img id="2faQrcode" class="hide-on-med-and-down" /> | ||
222 | <script> | ||
223 | document.getElementById('2faQrcode').src = jrQrcode.getQrBase64('{{ OtpQrCode }}'); | ||
224 | </script> | ||
225 | <br/><br/> | ||
226 | {{ 'config.form_user.two_factor_code_description_3'|trans }} | ||
227 | <br/><br/> | ||
228 | <strong>{{ app.user.getGoogleAuthenticatorSecret }}</strong> | ||
229 | <br/><br/> | ||
230 | {{ 'config.form_user.two_factor_code_description_4'|trans }} | ||
231 | <br/><br/> | ||
232 | <strong>{{ app.user.getBackupCodes|join("\n")|nl2br }}</strong> | ||
233 | </div> | ||
234 | {% endfor %} | ||
235 | {% endif %} | 232 | {% endif %} |
236 | |||
237 | {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} | ||
238 | {{ form_widget(form.user._token) }} | 233 | {{ form_widget(form.user._token) }} |
239 | </form> | 234 | </form> |
240 | </div> | 235 | </div> |