Route tenant admin PWA via /event-admin

This commit is contained in:
Codex Agent
2025-10-10 15:20:52 +02:00
parent 417b1da484
commit 52197f216d
20 changed files with 112 additions and 75 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Mail\ContactConfirmation;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Log;
@@ -53,6 +54,8 @@ class MarketingController extends Controller
->subject('Neue Kontakt-Anfrage');
});
Mail::to($request->email)->queue(new ContactConfirmation($request->name));
return redirect()->back()->with('success', 'Nachricht gesendet!');
}
@@ -109,7 +112,7 @@ class MarketingController extends Controller
'refunded' => false,
]);
return redirect('/admin')->with('success', __('marketing.packages.free_assigned'));
return redirect('/event-admin')->with('success', __('marketing.packages.free_assigned'));
}
if ($package->type === 'reseller') {
@@ -338,13 +341,13 @@ class MarketingController extends Controller
$request->session()->flash('error', 'Zahlung konnte nicht abgeschlossen werden.');
} catch (\Exception $e) {
Log::error('PayPal success error: ' . $e->getMessage());
$request->session()->flash('error', 'Fehler beim Abschließen der Zahlung.');
$request->session()->flash('error', 'Fehler beim Abschliessen der Zahlung.');
}
}
// Common logic: Redirect to admin if verified
if (Auth::check() && Auth::user()->email_verified_at) {
return redirect('/admin')->with('success', __('marketing.success.welcome'));
return redirect('/event-admin')->with('success', __('marketing.success.welcome'));
}
return Inertia::render('marketing/Success', compact('packageId'));
@@ -434,3 +437,4 @@ class MarketingController extends Controller
return Inertia::render('marketing/Occasions', ['type' => $type]);
}
}

View File

@@ -523,16 +523,16 @@ class OAuthController extends Controller
$error = $request->get('error');
if ($error) {
return redirect('/admin')->with('error', 'Stripe connection failed: '.$error);
return redirect('/event-admin')->with('error', 'Stripe connection failed: '.$error);
}
if (! $code || ! $state) {
return redirect('/admin')->with('error', 'Invalid callback parameters');
return redirect('/event-admin')->with('error', 'Invalid callback parameters');
}
$sessionState = session('stripe_state');
if (! hash_equals($state, (string) $sessionState)) {
return redirect('/admin')->with('error', 'Invalid state parameter');
return redirect('/event-admin')->with('error', 'Invalid state parameter');
}
$client = new Client();
@@ -554,7 +554,7 @@ class OAuthController extends Controller
$tokenData = json_decode($response->getBody()->getContents(), true);
if (! isset($tokenData['stripe_user_id'])) {
return redirect('/admin')->with('error', 'Failed to connect Stripe account');
return redirect('/event-admin')->with('error', 'Failed to connect Stripe account');
}
$tenant = Tenant::find(session('tenant_id'));
@@ -563,10 +563,11 @@ class OAuthController extends Controller
}
session()->forget(['stripe_state', 'tenant_id']);
return redirect('/admin')->with('success', 'Stripe account connected successfully');
return redirect('/event-admin')->with('success', 'Stripe account connected successfully');
} catch (\Exception $e) {
Log::error('Stripe OAuth error: '.$e->getMessage());
return redirect('/admin')->with('error', 'Connection error: '.$e->getMessage());
return redirect('/event-admin')->with('error', 'Connection error: '.$e->getMessage());
}
}
}