aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/authController.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2020-03-08 00:14:29 +0100
committerGravatar GitHub <noreply@github.com> 2020-03-08 00:14:29 +0100
commit51edbc1578fe49b281b39d91451d2b9df0092028 (patch)
treed82c6181797cbebe38e7a6dc5934237dc6597b15 /app/Controllers/authController.php
parent128b3367880fd18e4179123b4e533d14902b484c (diff)
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
Diffstat (limited to 'app/Controllers/authController.php')
-rw-r--r--app/Controllers/authController.php16
1 files changed, 13 insertions, 3 deletions
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')
+ );
}
}
}