Skip to content

Commit

Permalink
chore(playground): add password for invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Nov 18, 2024
1 parent baf7b3b commit f45a682
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion playground/server/routes/invoice.pdf.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
export default eventHandler(async (event) => {
const { page } = await hubBrowser()
await page.goto(`${getRequestURL(event).origin}/_invoice`)
let url = getRequestURL(event).origin
if (!import.meta.dev) {
url = url.replace('https://', `https://admin:${process.env.NUXT_ADMIN_PASSWORD || 'admin'}@`)
}
await page.goto(`${url}/_invoice`)

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

0 comments on commit f45a682

Please sign in to comment.