diff --git a/app/config/routing.yml b/app/config/routing.yml index f0f8f4b6f..af3e32b18 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -1,8 +1,3 @@ -wallabag_user: - resource: "@WallabagUserBundle/Controller/" - type: annotation - prefix: / - wallabag_api: resource: "@WallabagApiBundle/Resources/config/routing.yml" prefix: / diff --git a/app/config/security.yml b/app/config/security.yml index d7d8c12b1..576cfd25d 100644 --- a/app/config/security.yml +++ b/app/config/security.yml @@ -18,6 +18,7 @@ security: oauth_token: pattern: ^/oauth/v2/token security: false + api: pattern: /api/.* fos_oauth: true diff --git a/src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php deleted file mode 100644 index 5614d8b25..000000000 --- a/src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php +++ /dev/null @@ -1,54 +0,0 @@ -doctrine = $doctrine; - } - - public function buildForm(FormBuilderInterface $builder, array $options) - { - $builder - ->add('email', 'email', array( - 'required' => true, - 'constraints' => array( - new Constraints\Email(), - new Constraints\NotBlank(), - new Constraints\Callback(array(array($this, 'validateEmail'))), - ), - )) - ; - } - - public function getName() - { - return 'forgot_password'; - } - - public function validateEmail($email, ExecutionContextInterface $context) - { - $user = $this->doctrine - ->getRepository('WallabagUserBundle:User') - ->findOneByEmail($email); - - if (!$user) { - $context->addViolationAt( - 'email', - 'No user found with this email', - array(), - $email - ); - } - } -} diff --git a/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php deleted file mode 100644 index 38f1a1054..000000000 --- a/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php +++ /dev/null @@ -1,35 +0,0 @@ -add('new_password', 'repeated', array( - 'type' => 'password', - 'invalid_message' => 'The password fields must match.', - 'required' => true, - 'first_options' => array('label' => 'New password'), - 'second_options' => array('label' => 'Repeat new password'), - 'constraints' => array( - new Constraints\Length(array( - 'min' => 8, - 'minMessage' => 'Password should by at least 8 chars long', - )), - new Constraints\NotBlank(), - ), - )) - ; - } - - public function getName() - { - return 'change_passwd'; - } -}