mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
fix(console): send /recover without a reset token to the recovery form
The console reset page requires userId and secret, so /recover only lands there when both are present and otherwise opens /recovery.
This commit is contained in:
1 parent
db029c352a
commit
4ed17e6602
5 files changed
+11
-6
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user