]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Security/Authentication/Encoder/WallabagPasswordEncoder.php
Handle password change
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Security / Authentication / Encoder / WallabagPasswordEncoder.php
index 56f1affe32b8b6f615f07528b15037dd9f505db6..fcfe418bf966d076bb4c0e24f826010527ac47c8 100644 (file)
@@ -41,10 +41,6 @@ class WallabagPasswordEncoder extends BasePasswordEncoder
      */
     public function encodePassword($raw, $salt)
     {
-        if (null === $this->username) {
-            throw new \LogicException('We can not check the password without a username.');
-        }
-
         if ($this->isPasswordTooLong($raw)) {
             throw new BadCredentialsException('Invalid password.');
         }
@@ -71,6 +67,10 @@ class WallabagPasswordEncoder extends BasePasswordEncoder
      */
     protected function mergePasswordAndSalt($password, $salt)
     {
+        if (null === $this->username) {
+            throw new \LogicException('We can not check the password without a username.');
+        }
+
         if (empty($salt)) {
             return $password;
         }