fix: add metadata-based Stripe customer lookup in verify-checkout for reliable post-subscription plan detection (#538)

This commit is contained in:
ajaysi
2026-05-26 15:25:05 +05:30
parent 6331671c6a
commit 96fa469fe8
71 changed files with 3366 additions and 17182 deletions

View File

@@ -103,6 +103,7 @@ class GSCBrainstormAPI {
}
return apiClient.create({
headers: { Authorization: `Bearer ${token}` },
timeout: 300000, // 5 minutes — LLM calls via wavespeed can take 2+ minutes
});
}

View File

@@ -98,6 +98,29 @@ export const HeaderBar: React.FC<HeaderBarProps> = ({
</Typography>
</Stack>
<Box sx={{
flex: { xs: '1 1 100%', md: '0 1 auto' },
order: { xs: 3, md: 0 },
mt: { xs: 0.75, md: 0 },
}}>
<PhaseNavigation
phases={phases}
currentPhase={currentPhase}
onPhaseClick={onPhaseClick}
copilotKitAvailable={copilotKitAvailable}
actionHandlers={actionHandlers}
researchKeywords={researchKeywords}
hasResearch={hasResearch}
hasOutline={hasOutline}
outlineConfirmed={outlineConfirmed}
hasContent={hasContent}
contentConfirmed={contentConfirmed}
hasSEOAnalysis={hasSEOAnalysis}
seoRecommendationsApplied={seoRecommendationsApplied}
hasSEOMetadata={hasSEOMetadata}
/>
</Box>
<Stack direction="row" spacing={1} alignItems="center">
<HeaderControls colorMode="light" showAlerts={true} showUser={true} />
@@ -161,25 +184,6 @@ export const HeaderBar: React.FC<HeaderBarProps> = ({
</Menu>
</Stack>
</Stack>
<Box sx={{ mt: 1 }}>
<PhaseNavigation
phases={phases}
currentPhase={currentPhase}
onPhaseClick={onPhaseClick}
copilotKitAvailable={copilotKitAvailable}
actionHandlers={actionHandlers}
researchKeywords={researchKeywords}
hasResearch={hasResearch}
hasOutline={hasOutline}
outlineConfirmed={outlineConfirmed}
hasContent={hasContent}
contentConfirmed={contentConfirmed}
hasSEOAnalysis={hasSEOAnalysis}
seoRecommendationsApplied={seoRecommendationsApplied}
hasSEOMetadata={hasSEOMetadata}
/>
</Box>
</Box>
);
};

View File

@@ -138,6 +138,35 @@ export const BrainstormButton: React.FC<BrainstormButtonProps> = ({
)}
</button>
{gscConnected && (
<span
style={{
display: 'inline-flex',
alignItems: 'center',
gap: '5px',
padding: '4px 10px',
borderRadius: '12px',
fontSize: '12px',
fontWeight: 500,
color: '#2e7d32',
background: '#e8f5e9',
border: '1px solid #a5d6a7',
whiteSpace: 'nowrap',
}}
>
<span
style={{
width: '8px',
height: '8px',
borderRadius: '50%',
background: '#4caf50',
boxShadow: '0 0 6px #4caf50',
}}
/>
GSC
</span>
)}
<GSCBrainstormModal
open={showModal}
onClose={() => {

View File

@@ -110,9 +110,13 @@ export const useGSCBrainstorm = (): UseGSCBrainstormReturn => {
const result = await gscBrainstormAPI.brainstorm(keywords, siteUrl);
setBrainstormResult(result);
return result;
} catch (error) {
const message =
error instanceof Error ? error.message : 'Failed to brainstorm topics. Please try again.';
} catch (error: any) {
let message = 'Failed to brainstorm topics. Please try again.';
if (error?.response?.data?.detail) {
message = error.response.data.detail;
} else if (error instanceof Error) {
message = error.message;
}
setBrainstormError(message);
return null;
} finally {

View File

@@ -174,7 +174,6 @@ export function usePhaseValidation(
currentPhase,
userSelectedPhase,
setCurrentPhase,
oscillationGuardRef,
emptyPhaseId,
research,
]);