Skip to content

Commit f45a682

Browse files
committed
chore(playground): add password for invoice
1 parent baf7b3b commit f45a682

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

playground/server/routes/invoice.pdf.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
export default eventHandler(async (event) => {
22
const { page } = await hubBrowser()
3-
await page.goto(`${getRequestURL(event).origin}/_invoice`)
3+
let url = getRequestURL(event).origin
4+
if (!import.meta.dev) {
5+
url = url.replace('https://', `https://admin:${process.env.NUXT_ADMIN_PASSWORD || 'admin'}@`)
6+
}
7+
await page.goto(`${url}/_invoice`)
48

59
setHeader(event, 'Content-Type', 'application/pdf')
610
return page.pdf({ format: 'A4' })

0 commit comments

Comments
 (0)