Преглед на файлове

Replacing hardcode value of sha1 for the Registering Password Encoder

jmontoya преди 11 години
родител
ревизия
efb108bb64
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      main/inc/services.php

+ 3 - 3
main/inc/services.php

@@ -70,14 +70,14 @@ $app->register(new Silex\Provider\SecurityServiceProvider(), array(
     )
 ));
 
-// Registering Password encoder
-// @todo fix hardcoded sha1 value
+// Registering Password encoder.
+// @todo test with the "none" encrypt method.
 use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
 $app['security.encoder.digest'] = $app->share(function($app) {
     // use the sha1 algorithm
     // don't base64 encode the password
     // use only 1 iteration
-    return new MessageDigestPasswordEncoder('sha1', false, 1);
+    return new MessageDigestPasswordEncoder($app['configuration']['password_encryption'], false, 1);
 });
 
 // What to do when login success?