Fix auth form errors and redirects: Add React keys/useEffects for error rendering and scroll, Inertia::location in controllers for SPA navigation, extend RegistrationTest and add E2E. Update docs (changes/2025-10-02-registration-fixes.md, prp/13-backend-authentication.md). Add new UI components (accordion, carousel, progress, table, tabs), marketing/legal pages (Blog, Kontakt, Datenschutz, etc.), fonts, user migration (remove_name), views/css/package updates, seeders/factories.
This commit is contained in:
56
app/Exceptions/Handler.php
Normal file
56
app/Exceptions/Handler.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Inertia\Inertia;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* The list of the inputs that are never flashed to the session on validation exceptions.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $dontFlash = [
|
||||
'current_password',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register the exception handling callbacks for the application.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->reportable(function (Throwable $e) {
|
||||
//
|
||||
});
|
||||
}
|
||||
|
||||
public function render($request, Throwable $e)
|
||||
{
|
||||
\Illuminate\Support\Facades\Log::info('Handler render called', ['inertia' => $request->inertia(), 'exception' => get_class($e)]);
|
||||
if ($request->inertia()) {
|
||||
if ($e instanceof ValidationException) {
|
||||
\Illuminate\Support\Facades\Log::info('ValidationException in Inertia', ['errors' => $e->errors()]);
|
||||
return response()->json([
|
||||
'message' => 'The given data was invalid.',
|
||||
'errors' => $e->errors(),
|
||||
], 422)->header('X-Inertia-Error', 'true');
|
||||
}
|
||||
|
||||
if ($e instanceof \Exception) {
|
||||
\Illuminate\Support\Facades\Log::info('Exception in Inertia', ['message' => $e->getMessage()]);
|
||||
return response()->json([
|
||||
'message' => 'Registrierung fehlgeschlagen.',
|
||||
'errors' => ['general' => $e->getMessage()],
|
||||
], 500)->header('X-Inertia-Error', 'true');
|
||||
}
|
||||
}
|
||||
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user