diff --git a/src/Appwrite/Platform/Modules/Console/Http/Redirects/Base.php b/src/Appwrite/Platform/Modules/Console/Http/Redirects/Base.php index 7c426731d4..888bf711f8 100644 --- a/src/Appwrite/Platform/Modules/Console/Http/Redirects/Base.php +++ b/src/Appwrite/Platform/Modules/Console/Http/Redirects/Base.php @@ -25,7 +25,7 @@ abstract class Base extends Action /** * Console route to land on, the request path unless the console names it differently. */ - protected function getTarget(string $path): string + protected function getTarget(string $path, array $params): string { return $path; } @@ -54,8 +54,8 @@ abstract class Base extends Action } $url = parse_url($request->getURI()); - $target = $consoleUrl . $this->getTarget($url['path'] ?? ''); $params = $request->getParams(); + $target = $consoleUrl . $this->getTarget($url['path'] ?? '', $params); if (!empty($params)) { $target .= "?" . \http_build_query($params); } diff --git a/src/Appwrite/Platform/Modules/Console/Http/Redirects/Invite/Get.php b/src/Appwrite/Platform/Modules/Console/Http/Redirects/Invite/Get.php index 12e686113e..ef70ba5618 100644 --- a/src/Appwrite/Platform/Modules/Console/Http/Redirects/Invite/Get.php +++ b/src/Appwrite/Platform/Modules/Console/Http/Redirects/Invite/Get.php @@ -16,7 +16,7 @@ class Get extends Base return '/invite'; } - protected function getTarget(string $path): string + protected function getTarget(string $path, array $params): string { return '/join'; } diff --git a/src/Appwrite/Platform/Modules/Console/Http/Redirects/Login/Get.php b/src/Appwrite/Platform/Modules/Console/Http/Redirects/Login/Get.php index cf44ef7010..4d1bdce0f9 100644 --- a/src/Appwrite/Platform/Modules/Console/Http/Redirects/Login/Get.php +++ b/src/Appwrite/Platform/Modules/Console/Http/Redirects/Login/Get.php @@ -16,7 +16,7 @@ class Get extends Base return '/login'; } - protected function getTarget(string $path): string + protected function getTarget(string $path, array $params): string { return '/sign-in'; } diff --git a/src/Appwrite/Platform/Modules/Console/Http/Redirects/Recover/Get.php b/src/Appwrite/Platform/Modules/Console/Http/Redirects/Recover/Get.php index 9c29db9d34..38f8aec7ea 100644 --- a/src/Appwrite/Platform/Modules/Console/Http/Redirects/Recover/Get.php +++ b/src/Appwrite/Platform/Modules/Console/Http/Redirects/Recover/Get.php @@ -16,8 +16,13 @@ class Get extends Base return '/recover'; } - protected function getTarget(string $path): string + protected function getTarget(string $path, array $params): string { + // The reset page requires the emailed userId and secret, without them only the request form is usable + if (empty($params['userId']) || empty($params['secret'])) { + return '/recovery'; + } + return '/reset'; } } diff --git a/src/Appwrite/Platform/Modules/Console/Http/Redirects/Register/Get.php b/src/Appwrite/Platform/Modules/Console/Http/Redirects/Register/Get.php index 8a39daedd8..a48afeb1e9 100644 --- a/src/Appwrite/Platform/Modules/Console/Http/Redirects/Register/Get.php +++ b/src/Appwrite/Platform/Modules/Console/Http/Redirects/Register/Get.php @@ -16,7 +16,7 @@ class Get extends Base return '/register/*'; } - protected function getTarget(string $path): string + protected function getTarget(string $path, array $params): string { return '/sign-up'; }