STripe Paymen and PK payemtns and many othe rbacekd and froentened issues

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-07 05:51:36 +00:00
parent 87d1662a18
commit 0386d4bf33
24 changed files with 1079 additions and 174 deletions

View File

@@ -357,8 +357,20 @@ export const useAuthStore = create<AuthState>()(
throw new Error('Failed to save login session. Please try again.');
}
// Return user data for success handling
return userData;
// Return full response data for success handling (includes checkout_url for payment redirects)
console.log('Extracting checkout_url:', {
'responseData.checkout_url': responseData.checkout_url,
'data.checkout_url': data.checkout_url,
'data.data?.checkout_url': data.data?.checkout_url,
responseData: responseData,
});
return {
...userData,
checkout_url: responseData.checkout_url || data.checkout_url || data.data?.checkout_url,
checkout_session_id: responseData.checkout_session_id || data.checkout_session_id || data.data?.checkout_session_id,
paypal_order_id: responseData.paypal_order_id || data.paypal_order_id || data.data?.paypal_order_id,
};
} catch (error: any) {
// ALWAYS reset loading on error - critical to prevent stuck state
set({ loading: false });