You've already forked Atomcms-edit
fix: replace route closures with controllers, add Argon2id password migration
- Replace closures in web.php and auth.php with dedicated controllers (LoginRedirectController, LogoutController, TwoFactorChallengeController, EmailVerificationController) to fix route caching issues - Add migration to increase password column to VARCHAR(255) for Argon2id support - Fix 500 error caused by route cache incompatibility with closures
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class EmailVerificationController extends Controller
|
||||
{
|
||||
public function __invoke(Request $request): RedirectResponse
|
||||
{
|
||||
$request->user()->sendEmailVerificationNotification();
|
||||
|
||||
return back()->with('status', 'verification-link-sent');
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
|
||||
class LoginRedirectController extends Controller
|
||||
{
|
||||
public function __invoke(): RedirectResponse
|
||||
{
|
||||
return to_route('welcome');
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
|
||||
class LogoutController extends Controller
|
||||
{
|
||||
public function __invoke(): RedirectResponse
|
||||
{
|
||||
Auth::guard('web')->logout();
|
||||
Session::invalidate();
|
||||
Session::regenerateToken();
|
||||
|
||||
return redirect('/');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class TwoFactorChallengeController extends Controller
|
||||
{
|
||||
public function __invoke(): View
|
||||
{
|
||||
return view('auth.two-factor-challenge');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user