From 51edbc1578fe49b281b39d91451d2b9df0092028 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 8 Mar 2020 00:14:29 +0100 Subject: Improve login and registration pages (#2794) * Keep the user on login page on failure * Show an error if username already exists * Check the password format in the backend * Return a better message if username is invalid * Add a title to the login page * wip: Improve look of login and register pages * Set a capital M in username help message On the registration page, username tip started with a minuscule, while the password tip started with a capital. * Change message if username is taken --- app/Controllers/authController.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'app/Controllers/authController.php') diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php index e2e1aaa22..5874b312d 100644 --- a/app/Controllers/authController.php +++ b/app/Controllers/authController.php @@ -109,6 +109,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { public function formLoginAction() { invalidateHttpCache(); + Minz_View::prependTitle(_t('gen.auth.login') . ' ยท '); Minz_View::appendScript(Minz_Url::display('/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js'))); $conf = Minz_Configuration::get('system'); @@ -122,7 +123,10 @@ class FreshRSS_auth_Controller extends Minz_ActionController { $conf = get_user_configuration($username); if ($conf == null) { - Minz_Error::error(403, array(_t('feedback.auth.login.invalid')), false); + Minz_Request::bad( + _t('feedback.auth.login.invalid'), + array('c' => 'auth', 'a' => 'login') + ); return; } @@ -151,7 +155,10 @@ class FreshRSS_auth_Controller extends Minz_ActionController { ' user=' . $username . ', nonce=' . $nonce . ', c=' . $challenge); - Minz_Error::error(403, array(_t('feedback.auth.login.invalid')), false); + Minz_Request::bad( + _t('feedback.auth.login.invalid'), + array('c' => 'auth', 'a' => 'login') + ); } } elseif (FreshRSS_Context::$system_conf->unsafe_autologin_enabled) { $username = Minz_Request::param('u', ''); @@ -182,7 +189,10 @@ class FreshRSS_auth_Controller extends Minz_ActionController { array('c' => 'index', 'a' => 'index')); } else { Minz_Log::warning('Unsafe password mismatch for user ' . $username); - Minz_Error::error(403, array(_t('feedback.auth.login.invalid')), false); + Minz_Request::bad( + _t('feedback.auth.login.invalid'), + array('c' => 'auth', 'a' => 'login') + ); } } } -- cgit v1.2.3