Harden invoice public links and tighten draft UI.

Use publicId in links, compact key-point/account labels, English business names, and readable favicon deploy perms.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-07-26 12:00:10 +03:30
co-authored by Cursor
parent cbffb23ec3
commit 2e40d5eb4c
11 changed files with 152 additions and 107 deletions
+6 -6
View File
@@ -11,20 +11,20 @@ export function isAllowedAdminHost(hostname = window.location.hostname): boolean
/**
* Public invoice URL for platform invoices.
* Local/dev: current origin (`https://meshkee.app:5174/invoices/{id}`) so the show page is reachable.
* Production: `https://{VITE_INVOICE_PUBLIC_DOMAIN}/invoices/{id}` (default meshkee.com).
* Local/dev: current origin (`https://meshkee.app:5174/invoices/{publicId}`) so the show page is reachable.
* Production: `https://{VITE_INVOICE_PUBLIC_DOMAIN}/invoices/{publicId}` (default meshkee.com).
* Override either with `VITE_INVOICE_PUBLIC_BASE_URL` (full origin, optional path prefix).
*/
export function getPlatformInvoicePublicUrl(invoiceId: string): string {
export function getPlatformInvoicePublicUrl(publicId: string): string {
const baseOverride = import.meta.env.VITE_INVOICE_PUBLIC_BASE_URL?.trim()
if (baseOverride) {
return `${baseOverride.replace(/\/$/, '')}/invoices/${invoiceId}`
return `${baseOverride.replace(/\/$/, '')}/invoices/${publicId}`
}
if (import.meta.env.DEV) {
return `${window.location.origin}/invoices/${invoiceId}`
return `${window.location.origin}/invoices/${publicId}`
}
const domain = import.meta.env.VITE_INVOICE_PUBLIC_DOMAIN?.trim() || 'meshkee.com'
return `https://${domain}/invoices/${invoiceId}`
return `https://${domain}/invoices/${publicId}`
}
/** Marketing / main business site for platform invoices (default https://meshkee.com). */