Route tenant admin PWA via /event-admin
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user