Separate the update API password endpoint (#2675)

* Extract hashPassword method from userController

* Extract and refactor fever key-related methods

* Move update of API password to dedicated action

* Simplify the controller by refactoring feverUtil

* Add locales
This commit is contained in:
Marien Fressinaud
2019-12-03 23:11:06 +01:00
committed by Alexandre Alapetite
parent 15b8ef8f40
commit d0f1f9f141
40 changed files with 292 additions and 73 deletions

View File

@@ -47,7 +47,7 @@ class FreshRSS_javascript_Controller extends Minz_ActionController {
Minz_Log::notice('Nonce failure due to invalid username!');
}
//Failure: Return random data.
$this->view->salt1 = sprintf('$2a$%02d$', FreshRSS_user_Controller::BCRYPT_COST);
$this->view->salt1 = sprintf('$2a$%02d$', FreshRSS_password_Util::BCRYPT_COST);
$alphabet = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for ($i = 22; $i > 0; $i--) {
$this->view->salt1 .= $alphabet[mt_rand(0, 63)];