diff --git a/app/Controllers/AuthController.php b/app/Controllers/AuthController.php index bf7e746..f638ee8 100644 --- a/app/Controllers/AuthController.php +++ b/app/Controllers/AuthController.php @@ -43,19 +43,16 @@ class AuthController extends Controller */ public function logout() { - if (!session_check('s')) { - $message = 'Validation failed, this logout attempt was possibly forged.'; - $redirect = $_REQUEST['redirect'] ?? route('main.index'); - return view('global/information', compact('message', 'redirect')); + if (!session_check()) { + return view('auth/logout'); } // Destroy the active session CurrentSession::stop(); // Return true indicating a successful logout - $message = 'Goodbye!'; - $redirect = route('auth.login'); - return view('global/information', compact('message', 'redirect')); + header('Location: ' . route('auth.login')); + return; } /** diff --git a/resources/views/yuuno/auth/logout.twig b/resources/views/yuuno/auth/logout.twig new file mode 100644 index 0000000..635719f --- /dev/null +++ b/resources/views/yuuno/auth/logout.twig @@ -0,0 +1,18 @@ +{% extends 'master.twig' %} + +{% set title = 'Logout' %} + +{% block content %} +
+
+
+ Are you sure? +
+
+
+ +
+
+
+
+{% endblock %} diff --git a/resources/views/yuuno/master.twig b/resources/views/yuuno/master.twig index 5c67291..1564490 100644 --- a/resources/views/yuuno/master.twig +++ b/resources/views/yuuno/master.twig @@ -53,7 +53,7 @@ {% endif %} - + {% else %} diff --git a/routes.php b/routes.php index 8d67591..8222f8e 100644 --- a/routes.php +++ b/routes.php @@ -52,6 +52,7 @@ Routerv1::group(['before' => 'maintenance'], function () { }); Routerv1::group(['before' => 'loginCheck'], function () { Routerv1::get('/logout', 'AuthController@logout', 'auth.logout'); + Routerv1::post('/logout', 'AuthController@logout', 'auth.logout'); }); // Link compatibility layer, prolly remove this in like a year diff --git a/sakura.php b/sakura.php index 4314a41..891a6be 100644 --- a/sakura.php +++ b/sakura.php @@ -94,7 +94,7 @@ if (!defined('IN_CLI')) { // ->methods('GET') // ->action('faq') // ->group( -// Route::path('sub') +// Route::path('sub/{meow}/{cock}?') // ->methods(['GET', 'POST']) // ->action('search') // ->name('main.search')