Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Feb 16, 2022
1 parent 3a4db01 commit 037744b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Expand Up @@ -5,6 +5,7 @@
use App\Http\Resources\User\UserResource;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use MicroweberPackages\App\Http\Middleware\SameSiteRefererMiddleware;

class UserLogoutController extends Controller
{
Expand All @@ -27,14 +28,21 @@ public function __construct()
*/
public function index(Request $request)
{
$ref = $request->headers->get('referer');

$same_site = app()->make(SameSiteRefererMiddleware::class);
$is_same_site = $same_site->isSameSite($ref);

if ($is_same_site) {
return logout();
}

return view('user::logout.index');
}

public function loginForm()
public function submit(Request $request)
{
// $parsed = view('user::admin.auth.index');
//
// return app()->parser->process($parsed);
return logout();
}

}
Expand Up @@ -7,7 +7,7 @@
<h3> {{ _e('Please confirm you want to logout') }} </h3>

<form class="form-horizontal" role="form" method="POST"
action="{{ route('logout.confirm') }}">
action="{{ route('logout.submit') }}">

@csrf

Expand Down
1 change: 0 additions & 1 deletion src/MicroweberPackages/User/routes/web.php
Expand Up @@ -31,7 +31,6 @@

Route::get('/logout', 'UserLogoutController@index')->name('logout');
Route::post('/logout', 'UserLogoutController@submit')->name('logout.submit');
Route::post('/logout-confirm', 'UserLogoutController@logout-confirm')->name('logout.confirm');


Route::get('email/verify/{id}/{hash}', 'UserVerifyController@verify')->name('verification.verify')
Expand Down

0 comments on commit 037744b

Please sign in to comment.