From 2db616b586f473238706e554e809086935e0f33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 13 Oct 2015 22:43:15 +0200 Subject: 2factor authentication via email --- .../UserBundle/Resources/config/services.yml | 19 +++++++++++++ .../themes/baggy/Authentication/form.html.twig | 32 +++++++++++++++++++++ .../themes/material/Authentication/form.html.twig | 33 ++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 src/Wallabag/UserBundle/Resources/views/themes/baggy/Authentication/form.html.twig create mode 100644 src/Wallabag/UserBundle/Resources/views/themes/material/Authentication/form.html.twig (limited to 'src/Wallabag/UserBundle/Resources') diff --git a/src/Wallabag/UserBundle/Resources/config/services.yml b/src/Wallabag/UserBundle/Resources/config/services.yml index e69de29b..9cdd247d 100644 --- a/src/Wallabag/UserBundle/Resources/config/services.yml +++ b/src/Wallabag/UserBundle/Resources/config/services.yml @@ -0,0 +1,19 @@ +parameters: + wallabag_user.twofactor.email.provider.class: Wallabag\UserBundle\Security\TwoFactor\Email\Helper + wallabag_user.twofactor.email.interactive_login_listener.class: Wallabag\UserBundle\Security\TwoFactor\Email\InteractiveLoginListener + wallabag_user.twofactor.email.request_listener.class: Wallabag\UserBundle\Security\TwoFactor\Email\RequestListener + +services: + wallabag_user.twofactor.email.provider: + class: %wallabag_user.twofactor.email.provider.class% + arguments: ['@doctrine.orm.entity_manager', '@mailer'] + wallabag_user.twofactor.email.interactive_login_listener: + class: %wallabag_user.twofactor.email.interactive_login_listener.class% + tags: + - { name: kernel.event_listener, event: security.interactive_login, method: onSecurityInteractiveLogin } + arguments: ['@wallabag_user.twofactor.email.provider'] + wallabag_user.twofactor.email.request_listener: + class: %wallabag_user.twofactor.email.request_listener.class% + tags: + - { name: kernel.event_listener, event: kernel.request, method: onCoreRequest, priority: -1 } + arguments: ['@wallabag_user.twofactor.email.provider', '@security.context', '@templating', '@router'] diff --git a/src/Wallabag/UserBundle/Resources/views/themes/baggy/Authentication/form.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/baggy/Authentication/form.html.twig new file mode 100644 index 00000000..5bb91081 --- /dev/null +++ b/src/Wallabag/UserBundle/Resources/views/themes/baggy/Authentication/form.html.twig @@ -0,0 +1,32 @@ +{% extends "WallabagUserBundle::layout.html.twig" %} + +{% block fos_user_content %} +
+
+ {% for flashMessage in app.session.flashbag.get("two_factor") %} +

{{ flashMessage|trans }}

+ {% endfor %} + +
+ + +
+ + {% if useTrustedOption %} +
+ + +
+ {% endif %} + +
+ {% trans %}Cancel{% endtrans %} + +
+
+ +
+{% endblock %} diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Authentication/form.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Authentication/form.html.twig new file mode 100644 index 00000000..fa0e3dc1 --- /dev/null +++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Authentication/form.html.twig @@ -0,0 +1,33 @@ +{% extends "WallabagUserBundle::layout.html.twig" %} + +{% block fos_user_content %} +
+
+
+ + {% for flashMessage in app.session.flashbag.get("two_factor") %} +

{{ flashMessage|trans }}

+ {% endfor %} + +
+ + +
+ + {% if useTrustedOption %} +
+ + +
+ {% endif %} +
+
+
+ {% trans %}Cancel{% endtrans %} + +
+
+{% endblock %} -- cgit v1.2.3 From 0d6a7929e17c84052cbb3e494d5e5c195c24ca04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 14 Oct 2015 17:10:12 +0200 Subject: add tests for 2factor authentication --- src/Wallabag/UserBundle/Resources/config/services.yml | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'src/Wallabag/UserBundle/Resources') diff --git a/src/Wallabag/UserBundle/Resources/config/services.yml b/src/Wallabag/UserBundle/Resources/config/services.yml index 9cdd247d..e69de29b 100644 --- a/src/Wallabag/UserBundle/Resources/config/services.yml +++ b/src/Wallabag/UserBundle/Resources/config/services.yml @@ -1,19 +0,0 @@ -parameters: - wallabag_user.twofactor.email.provider.class: Wallabag\UserBundle\Security\TwoFactor\Email\Helper - wallabag_user.twofactor.email.interactive_login_listener.class: Wallabag\UserBundle\Security\TwoFactor\Email\InteractiveLoginListener - wallabag_user.twofactor.email.request_listener.class: Wallabag\UserBundle\Security\TwoFactor\Email\RequestListener - -services: - wallabag_user.twofactor.email.provider: - class: %wallabag_user.twofactor.email.provider.class% - arguments: ['@doctrine.orm.entity_manager', '@mailer'] - wallabag_user.twofactor.email.interactive_login_listener: - class: %wallabag_user.twofactor.email.interactive_login_listener.class% - tags: - - { name: kernel.event_listener, event: security.interactive_login, method: onSecurityInteractiveLogin } - arguments: ['@wallabag_user.twofactor.email.provider'] - wallabag_user.twofactor.email.request_listener: - class: %wallabag_user.twofactor.email.request_listener.class% - tags: - - { name: kernel.event_listener, event: kernel.request, method: onCoreRequest, priority: -1 } - arguments: ['@wallabag_user.twofactor.email.provider', '@security.context', '@templating', '@router'] -- cgit v1.2.3