44use Neos \Flow \Annotations as Flow ;
55use Neos \Error \Messages \Message ;
66use Neos \Flow \Mvc \Controller \ActionController ;
7+ use Neos \Flow \Security \Context ;
78use Yeebase \TwoFactorAuthentication \Service \TwoFactorAuthenticationService ;
89
910abstract class AbstractTwoFactorAuthenticationManagementController extends ActionController
1011{
1112
13+ /**
14+ * @var Context
15+ * @Flow\Inject
16+ */
17+ protected $ securityContext ;
18+
1219 /**
1320 * @var TwoFactorAuthenticationService
1421 * @Flow\Inject
@@ -32,9 +39,9 @@ public function enableAction(string $secret)
3239
3340 if ($ this ->twoFactorAuthenticationService ->validateSecret ($ secret , $ account , true )) {
3441 $ this ->twoFactorAuthenticationService ->enableTwoFactorAuthentication ($ account );
35- $ this ->addFlashMessage ('Zwei-Faktor-Authentisierung aktiviert. ' );
42+ $ this ->addFlashMessage ('Two-Factor-Authentication activated. ' , '' , Message:: SEVERITY_OK , [], 1511944292 );
3643 } else {
37- $ this ->addFlashMessage ('Falsches Secret. ' , Message::SEVERITY_ERROR );
44+ $ this ->addFlashMessage ('Wrong Secret. ' , '' , Message::SEVERITY_ERROR , [], 1511944293 );
3845 }
3946
4047 $ this ->redirect ('configure ' );
@@ -46,9 +53,9 @@ public function disableAction(string $secret)
4653
4754 if ($ this ->twoFactorAuthenticationService ->validateSecret ($ secret , $ account )) {
4855 $ this ->twoFactorAuthenticationService ->disableTwoFactorAuthentication ($ account );
49- $ this ->addFlashMessage ('Zwei-Faktor-Authentisierung deaktiviert. ' );
56+ $ this ->addFlashMessage ('Two-Factor-Authentication deactivated. ' , '' , Message:: SEVERITY_OK , [], 1511944294 );
5057 } else {
51- $ this ->addFlashMessage ('Falsches Secret. ' , Message::SEVERITY_ERROR );
58+ $ this ->addFlashMessage ('Wrong Secret. ' , '' , Message::SEVERITY_ERROR , [], 1511944293 );
5259 }
5360
5461 $ this ->redirect ('configure ' );
0 commit comments