mirror of
https://github.com/getnamingo/registry.git
synced 2025-08-04 00:31:50 +02:00
Initial upload of the control panel
This commit is contained in:
parent
f21bd93fbc
commit
7eab26586c
791 changed files with 312718 additions and 0 deletions
22
cp/app/Middleware/GuestMiddleware.php
Normal file
22
cp/app/Middleware/GuestMiddleware.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Middleware;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
|
||||
/**
|
||||
* GuestMiddleware
|
||||
*
|
||||
* @author Hezekiah O. <support@hezecom.com>
|
||||
*/
|
||||
class GuestMiddleware extends Middleware
|
||||
{
|
||||
public function __invoke(Request $request, RequestHandler $handler)
|
||||
{
|
||||
$response = $handler->handle($request);
|
||||
if($this->container->get('auth')->isLogin()) {
|
||||
return redirect()->route('home');
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue