chore: remove vestigial onboarding OAuth flag and legacy plan env vars
The onboarding/connect and accounts screens now share the same NetworkConnectGrid with the same popup-close-and-reload flow, so the social_connect_onboarding flag no longer affects anything in the normal path. Remove the frontend plumbing (useOAuthPopup query param, the grid's onboarding prop) and the dormant backend scaffolding (the session flag in 6 OAuth controllers, getRedirectRoute, and the ignored isOnboarding arg); the YouTube no-channels error now redirects to app.accounts directly. Also drop the unused legacy plan price-id env vars from .env.example (only the Workspace plan remains).
This commit is contained in:
parent
3e15144399
commit
2d07002325
10 changed files with 6 additions and 42 deletions
|
|
@ -197,14 +197,6 @@ REQUIRE_CARD_FOR_TRIAL=true
|
|||
CASHIER_TRIAL_DAYS=8
|
||||
|
||||
# Stripe Plan Price IDs (one per plan × interval). Used by PlanSeeder.
|
||||
STRIPE_STARTER_MONTHLY=
|
||||
STRIPE_STARTER_YEARLY=
|
||||
STRIPE_PLUS_MONTHLY=
|
||||
STRIPE_PLUS_YEARLY=
|
||||
STRIPE_PRO_MONTHLY=
|
||||
STRIPE_PRO_YEARLY=
|
||||
STRIPE_MAX_MONTHLY=
|
||||
STRIPE_MAX_YEARLY=
|
||||
STRIPE_WORKSPACE_MONTHLY=
|
||||
STRIPE_WORKSPACE_YEARLY=
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public function connect(Request $request): Response|RedirectResponse
|
|||
session([
|
||||
'social_connect_workspace' => $workspace->id,
|
||||
'social_reconnect_id' => null,
|
||||
'social_connect_onboarding' => $request->boolean('onboarding'),
|
||||
]);
|
||||
|
||||
return Inertia::location(
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ public function connect(Request $request): Response|RedirectResponse
|
|||
session([
|
||||
'social_connect_workspace' => $workspace->id,
|
||||
'social_reconnect_id' => null,
|
||||
'social_connect_onboarding' => $request->boolean('onboarding'),
|
||||
]);
|
||||
|
||||
$url = Socialite::driver($this->driver)
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ public function connect(Request $request): Response|RedirectResponse
|
|||
session([
|
||||
'social_connect_workspace' => $workspace->id,
|
||||
'social_reconnect_id' => null,
|
||||
'social_connect_onboarding' => $request->boolean('onboarding'),
|
||||
]);
|
||||
|
||||
$url = Socialite::driver($this->driver)
|
||||
|
|
@ -234,9 +233,7 @@ private function connectInstagramAccount(Workspace $workspace, array $pageData,
|
|||
]),
|
||||
);
|
||||
|
||||
$isOnboarding = session('social_connect_onboarding', false);
|
||||
|
||||
return $this->popupCallback(true, __('accounts.popup_callback.connected'), $this->platform->value, $isOnboarding);
|
||||
return $this->popupCallback(true, __('accounts.popup_callback.connected'), $this->platform->value);
|
||||
}
|
||||
|
||||
private function fetchPagesWithInstagram(string $userToken): array
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ public function connect(Request $request): SymfonyResponse|RedirectResponse
|
|||
session([
|
||||
'social_connect_workspace' => $workspace->id,
|
||||
'linkedin_page_reconnect_id' => null,
|
||||
'social_connect_onboarding' => $request->boolean('onboarding'),
|
||||
]);
|
||||
|
||||
return Inertia::location(
|
||||
|
|
|
|||
|
|
@ -120,7 +120,6 @@ protected function redirectToProvider(Request $request, string $driver, array $s
|
|||
}
|
||||
|
||||
session(['social_connect_workspace' => $workspace->id]);
|
||||
session(['social_connect_onboarding' => $request->boolean('onboarding')]);
|
||||
|
||||
return Inertia::location(
|
||||
Socialite::driver($driver)
|
||||
|
|
@ -186,12 +185,7 @@ protected function handleCallback(
|
|||
|
||||
protected function forgetSocialConnectSession(): void
|
||||
{
|
||||
session()->forget(['social_connect_workspace', 'social_connect_onboarding']);
|
||||
}
|
||||
|
||||
protected function getRedirectRoute(): string
|
||||
{
|
||||
return session('social_connect_onboarding', false) ? 'app.onboarding.connect' : 'app.accounts';
|
||||
session()->forget('social_connect_workspace');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ public function connect(Request $request): Response|RedirectResponse
|
|||
session([
|
||||
'social_connect_workspace' => $workspace->id,
|
||||
'social_reconnect_id' => null,
|
||||
'social_connect_onboarding' => $request->boolean('onboarding'),
|
||||
]);
|
||||
|
||||
return $this->redirectToGoogle();
|
||||
|
|
@ -154,14 +153,13 @@ public function selectChannel(Request $request)
|
|||
$channels = $this->fetchChannels(data_get($oauthData, 'access_token'));
|
||||
|
||||
if (empty($channels)) {
|
||||
$redirectRoute = $this->getRedirectRoute();
|
||||
$this->forgetSocialConnectSession();
|
||||
session()->forget('youtube_oauth');
|
||||
|
||||
session()->flash('flash.banner', __('accounts.flash.no_youtube_channels'));
|
||||
session()->flash('flash.bannerStyle', 'danger');
|
||||
|
||||
return redirect()->route($redirectRoute);
|
||||
return redirect()->route('app.accounts');
|
||||
}
|
||||
|
||||
return inertia('accounts/YouTubeChannelSelect', [
|
||||
|
|
|
|||
|
|
@ -31,12 +31,10 @@ const props = withDefaults(
|
|||
defineProps<{
|
||||
platforms: AvailablePlatform[];
|
||||
connectedAccounts?: ConnectedAccount[];
|
||||
onboarding?: boolean;
|
||||
gridClass?: string;
|
||||
}>(),
|
||||
{
|
||||
connectedAccounts: () => [],
|
||||
onboarding: false,
|
||||
gridClass: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-5',
|
||||
},
|
||||
);
|
||||
|
|
@ -185,10 +183,7 @@ const openConnect = (platformValue: string) => {
|
|||
return;
|
||||
}
|
||||
|
||||
openOAuthPopup(
|
||||
platformValue,
|
||||
props.onboarding ? { onboarding: '1' } : undefined,
|
||||
);
|
||||
openOAuthPopup(platformValue);
|
||||
};
|
||||
|
||||
const connectPlatform = (platformValue: string) => {
|
||||
|
|
|
|||
|
|
@ -9,20 +9,12 @@ const POPUP_HEIGHT = 700;
|
|||
* message. The listener is wired to the calling component's lifecycle.
|
||||
*/
|
||||
export const useOAuthPopup = (onSuccess: () => void) => {
|
||||
const openOAuthPopup = (
|
||||
platform: string,
|
||||
query?: Record<string, string>,
|
||||
) => {
|
||||
const openOAuthPopup = (platform: string) => {
|
||||
const left = window.screenX + (window.outerWidth - POPUP_WIDTH) / 2;
|
||||
const top = window.screenY + (window.outerHeight - POPUP_HEIGHT) / 2;
|
||||
|
||||
const search =
|
||||
query && Object.keys(query).length > 0
|
||||
? `?${new URLSearchParams(query).toString()}`
|
||||
: '';
|
||||
|
||||
window.open(
|
||||
`/connect/${platform}${search}`,
|
||||
`/connect/${platform}`,
|
||||
'oauth-popup',
|
||||
`width=${POPUP_WIDTH},height=${POPUP_HEIGHT},left=${left},top=${top},scrollbars=yes,resizable=yes`,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ const submit = (): void => {
|
|||
<NetworkConnectGrid
|
||||
:platforms="platforms"
|
||||
:connected-accounts="accounts"
|
||||
onboarding
|
||||
grid-class="grid-cols-3 sm:grid-cols-4 lg:grid-cols-7"
|
||||
/>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue