feat: ✨ Aggiunto logout
This commit is contained in:
parent
ac629b928d
commit
d8a77e47f1
|
@ -2,14 +2,9 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
use Illuminate\Auth\Events\PasswordReset;
|
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
use Illuminate\Support\Facades\Hash;
|
|
||||||
use Illuminate\Support\Facades\Password;
|
|
||||||
use Illuminate\Support\Str;
|
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
use JetBrains\PhpStorm\ArrayShape;
|
use JetBrains\PhpStorm\ArrayShape;
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import {
|
||||||
} from 'async-wait-until';
|
} from 'async-wait-until';
|
||||||
import $ from 'cash-dom';
|
import $ from 'cash-dom';
|
||||||
import m from 'mithril';
|
import m from 'mithril';
|
||||||
|
import redaxios from 'redaxios';
|
||||||
|
|
||||||
import {__} from './utils';
|
import {__} from './utils';
|
||||||
|
|
||||||
|
@ -45,3 +46,8 @@ createInertiaApp({
|
||||||
import('./_material');
|
import('./_material');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#logout-button').on('click', async () => {
|
||||||
|
await redaxios.post(window.route('auth.logout'));
|
||||||
|
window.location.href = window.route('auth.login');
|
||||||
|
});
|
||||||
|
|
|
@ -27,11 +27,8 @@
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
</a>
|
</a>
|
||||||
<br>
|
<br>
|
||||||
<form action="" method="post">
|
<mwc-button id="logout-button" outlined label="@lang('Esci')" style="margin-top: 16px;">
|
||||||
@csrf
|
<i class="mdi mdi-logout-variant" slot="icon"></i>
|
||||||
<mwc-button outlined type="submit" label="@lang('Esci')" style="margin-top: 16px;">
|
</mwc-button>
|
||||||
<i class="mdi mdi-logout-variant" slot="icon"></i>
|
|
||||||
</mwc-button>
|
|
||||||
</form>
|
|
||||||
<hr>
|
<hr>
|
||||||
</mwc-menu>
|
</mwc-menu>
|
||||||
|
|
|
@ -39,11 +39,12 @@ Route::name('auth.')
|
||||||
->group(static function () {
|
->group(static function () {
|
||||||
Route::inertia('login', 'LoginPage')
|
Route::inertia('login', 'LoginPage')
|
||||||
->name('login');
|
->name('login');
|
||||||
|
|
||||||
Route::post('login', [AuthController::class, 'authenticate'])
|
Route::post('login', [AuthController::class, 'authenticate'])
|
||||||
->name('authenticate');
|
->name('authenticate');
|
||||||
|
|
||||||
/*Route::post('logout', 'Auth\LoginController@logout')
|
Route::post('logout', [AuthController::class, 'logout'])
|
||||||
->name('auth.logout');*/
|
->name('logout');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::name('password.')
|
Route::name('password.')
|
||||||
|
|
Loading…
Reference in New Issue