Share customer session cookies with the storefront and polish business settings.
Keep JWT login mirrored on the tenant cookie domain, improve e-payment settings UX, and add a storefront link from the customer sidebar. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
c289de5d2e
commit
dc570c1e7f
@@ -16,7 +16,18 @@ export async function getWebsiteBusinessInfo(host: string, signal?: AbortSignal)
|
||||
})
|
||||
}
|
||||
|
||||
/** Public storefront URL for the tenant (e.g. https://sanihome.ir). */
|
||||
/** Public storefront URL for the tenant (e.g. https://sanihome.com). */
|
||||
export function getWebsiteUrl(domain = getTenantDomain()) {
|
||||
return `${window.location.protocol}//${domain}`
|
||||
const configured = (import.meta.env.VITE_WEBSITE_ORIGIN as string | undefined)?.replace(
|
||||
/\/$/,
|
||||
'',
|
||||
)
|
||||
if (configured) return configured
|
||||
|
||||
const { protocol, port } = window.location
|
||||
// Local customer app is :5175; Sanihome Next storefront runs on :3001
|
||||
if (import.meta.env.DEV && (port === '5175' || port === '')) {
|
||||
return `${protocol}//${domain}:3001`
|
||||
}
|
||||
return `${protocol}//${domain}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user