From 26229c110fb92646b36c7b2f48ac7518fd3810a5 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Fri, 17 Mar 2023 02:19:27 +0200 Subject: set algorithns for user authentication and authorization --- core/classes/Request.php | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'core/classes/Request.php') diff --git a/core/classes/Request.php b/core/classes/Request.php index 20b82c7..6b82dc5 100644 --- a/core/classes/Request.php +++ b/core/classes/Request.php @@ -89,6 +89,59 @@ class Request // if SCRF-token is not valideted, serve 403 return $array; } + + + + + public function isAjax(): bool + { + // check headers 'XMLHttpRequest' == $this->headers->get('X-Requested-With'); + } + + + public function isSecure(): bool + { + // chech if HTTPS + } + + + public function hasSession(): bool + { + // chech if Session exist + } + + + /** + * Get the user making the request. + * + * @param string|null $guard + * @return mixed + */ + public function user($guard = null) + { + // return call_user_func($this->getUserResolver(), $guard); + } + + public function getUserResolver() + { + // return $this->userResolver ?: function () { + // + // }; + } + + /** + * Set the user resolver callback. + * + * @param \Closure $callback + * @return $this + */ + public function setUserResolver(Closure $callback) + { + // $this->userResolver = $callback; + // return $this; + } + + } -- cgit v1.2.3