From 8eee7a509f27c47a68a0d150dc6c981c67a34cbf Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 18 Sep 2020 14:28:28 -0400 Subject: [PATCH] Update Process module interface for a new getAfterLoginUrl() method that Process modules can optionally implement to sanitize a requested URL to the module when the user is not logged in. This lets things like query strings and URL segments be retained after a user logs-in. --- wire/core/Process.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wire/core/Process.php b/wire/core/Process.php index 5a5175ab..baa717c2 100644 --- a/wire/core/Process.php +++ b/wire/core/Process.php @@ -600,4 +600,24 @@ abstract class Process extends WireData implements Module { $page = $this->wire('pages')->get("process=$moduleID, include=all"); return $page; } + + /** + * URL to redirect to after non-authenticated user is logged-in, or false if module does not support + * + * When supported, module should gather any input GET vars and URL segments that it recognizes, + * sanitize them, and return a URL for that request. ProcessLogin will redirect to the returned URL + * after user has successfully authenticated. + * + * If module does not support this, or only needs to support an integer 'id' GET var, then this + * method can return false. + * + * @param Page $page Requested page + * @return bool|string + * @sine 3.0.167 + * + */ + public static function getAfterLoginUrl(Page $page) { + if($page) {} + return false; + } }