Skip to content

Commit

Permalink
[cleanup] code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelfolaron committed May 25, 2024
1 parent b29c801 commit 8afdce2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
10 changes: 10 additions & 0 deletions app/Core/ConsoleKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ public static function artisanBinary()
});
}

/**
* Load and register the commands for the application.
*
* @return void
*/
protected function commands()
{
static $commandsLoaded;
Expand Down Expand Up @@ -181,6 +186,11 @@ protected function commands()
$commandsLoaded = true;
}

/**
* Schedule tasks to be executed.
*
* @return void
*/
private function schedule()
{
// Set default timezone
Expand Down
6 changes: 6 additions & 0 deletions app/Core/Middleware/Installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public function handle(IncomingRequest $request, Closure $next): Response

\Illuminate\Support\Facades\Cache::set('installed', true);

$route = Frontcontroller::getCurrentRoute();

if($session_says && $route == "install") {
return Frontcontroller::redirect(BASE_URL . "/auth/logout");
}

return $next($request);
}

Expand Down
5 changes: 4 additions & 1 deletion app/Domain/Auth/Controllers/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ public function get(array $params): Response
$url = urldecode($_GET['redirect']);

//Check for open redirects, don't allow redirects to external sites.
if (filter_var($url, FILTER_VALIDATE_URL) === false) {
if (
filter_var($url, FILTER_VALIDATE_URL) === false &&
!in_array($url, ["/auth/logout"])
) {
$redirectUrl = BASE_URL ."/" . $url;
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Install/Controllers/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function init(InstallRepository $installRepo)
$this->installRepo = $installRepo;

if ($this->installRepo->checkIfInstalled()) {
return FrontcontrollerCore::redirect(BASE_URL);
return FrontcontrollerCore::redirect(BASE_URL . "/");
}
}

Expand Down

0 comments on commit 8afdce2

Please sign in to comment.