Browse Source

Add default redirect when authenticating (#4778)

Alexis Degrugillier 3 years ago
parent
commit
4ec602e8e3
1 changed files with 6 additions and 2 deletions
  1. 6 2
      app/Controllers/authController.php

+ 6 - 2
app/Controllers/authController.php

@@ -159,8 +159,12 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController {
 
 				Minz_Translate::init(FreshRSS_Context::$user_conf->language);
 
-				// All is good, go back to the index.
-				Minz_Request::good(_t('feedback.auth.login.success'), Minz_Url::unserialize(Minz_Request::param('original_request')));
+				// All is good, go back to the original request or the index.
+				$url = Minz_Url::unserialize(Minz_Request::param('original_request'));
+				if ($url === null) {
+					$url = [ 'c' => 'index', 'a' => 'index' ];
+				}
+				Minz_Request::good(_t('feedback.auth.login.success'), $url);
 			} else {
 				Minz_Log::warning("Password mismatch for user={$username}, nonce={$nonce}, c={$challenge}");