changed the logout page a bit

This commit is contained in:
flash 2016-09-13 16:41:42 +02:00
parent bb21046e73
commit 77fc40e6d8
5 changed files with 25 additions and 9 deletions

View file

@ -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;
}
/**

View file

@ -0,0 +1,18 @@
{% extends 'master.twig' %}
{% set title = 'Logout' %}
{% block content %}
<div class="loginPage">
<div class="loginForm">
<div class="head">
Are you sure?
</div>
<form method="post" action="{{ route('auth.logout') }}" id="logoutForm">
<div class="centreAlign">
<button class="inputStyling" id="loginButton" name="session" value="{{ session_id() }}"><i class="fa fa-sign-out"></i> Logout</button>
</div>
</form>
</div>
</div>
{% endblock %}

View file

@ -53,7 +53,7 @@
<a class="menu-item fa-gavel" href="{{ route('manage.index') }}" title="Manage"></a>
{% endif %}
<a class="menu-item fa-cogs" href="{{ route('settings.index') }}" title="Settings"></a>
<a class="menu-item fa-sign-out" href="{{ route('auth.logout') }}?s={{ session_id() }}" title="Logout" id="headerLogoutLink"></a>
<a class="menu-item fa-sign-out" href="{{ route('auth.logout') }}" title="Logout"></a>
{% else %}
<a class="menu-item fa-magic" href="{{ route('auth.register') }}" title="Register"></a>
<a class="menu-item fa-sign-in" href="{{ route('auth.login') }}" title="Login"></a>

View file

@ -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

View file

@ -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')