* fix: set i18n cookie SameSite=lax to survive cross-domain redirects
The i18n language cookie was being reset to default after Supabase
email verification redirects because the cookie was using the default
SameSite=strict setting which doesn't survive cross-domain navigation.
Changes:
- Set cookieOptions.sameSite to 'lax' to allow cookie to persist through
cross-domain redirects (like Supabase auth flows)
- Set secure flag dynamically based on HTTPS protocol
- Set cookie path to '/' for site-wide availability
- Set cookie expiration to 1 year
- Change detection order to prioritize cookie over htmlTag
Bumps version to 2.23.4
* fix: set theme cookie SameSite=lax to survive cross-domain redirects
Apply the same fix as the i18n cookie to the theme cookie. The theme
preference cookie was also missing SameSite=lax attribute, causing it
to potentially be lost during cross-domain authentication flows.
Changes:
- Add SameSite=lax to theme cookie
- Add Secure flag conditionally based on HTTPS protocol
- Fix typo: setCookeTheme -> setCookieTheme
* fix: correct SameSite casing and add security to sidebar cookie
- Fix SameSite value to use proper capitalization (Lax instead of lax)
for better browser compatibility
- Add SameSite=Lax and conditional Secure flag to sidebar state cookie
- Add typeof window check for defensive programming
---------
Co-authored-by: Claude <noreply@anthropic.com>
This update separates the creation of i18n settings into its own function (@kit/i18n) and enhances the handling of language and namespace loading in i18n.client. It tracks loaded languages and namespaces, and prevents rendering if none are loaded or after a maximum number of iterations. The usage of Suspense has also been modified in root-providers to employ a null fallback.
The refactor includes the removal of clientInstance checks as they are unnecessary. Also, i18n-provider.tsx has been updated to use react-query instead of local state for client initialization. Lastly, error handling has been added to the server initialization process and the @tanstack/react-query package has been added to the project dependencies.
Updated i18n client to track not only loaded languages but also namespaces. The component will now remain suspended until all languages and namespaces are loaded. This improvement ensures that all necessary localisation resources are fully ready before rendering components.
Converted the `initializeI18nClient` function to an asynchronous function for a more straightforward implementation. Simultaneously, made some tweaks to the UI components, such as altering dimensions in `site-footer.tsx` and `site-page-header.tsx`, and refactoring the `FooterSectionHeading` component for easier maintenance and improved readability.
This commit updates multiple dependencies in the pnpm-lock.yaml file and imports the dynamic method from 'next/dynamic' in the site-header-account-section.tsx file. These updates are part of routine maintenance and improvement of the codebase. The import allows for dynamic imports, which can enhance performance.
Added error logging to the i18n client initialization to better handle and trace errors. Introduced React's Suspense component in `root-providers.tsx` to provide a fallback UI in case a component within the tree is not yet ready to render.
The join page's redirect functionality has been replaced with permanentRedirect. Adjustments were also made for handling conditional authentication and user account verification. Package upgrades were performed and the i18n client now checks if an instance is already initialized. The process tends to deliver performance benefits and enhancing the code readability.
Deleted the billing-redirect-button, checkout-redirect-button, and embedded-stripe-checkout components. Additionally, removed the shadcn directory, which encompassed billing-related icons. This change streamlines the subscription settings interface and organizes the system's payment management. This update is a stepping stone towards improving the billing system's overall architecture.