Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/danielroe/roe.dev. This is the code and content for my personal website, built in Nuxt. roe.dev
Something went wrong. Try again.
123456789101112131415161718192021222324import { sendPushoverNotification } from '../utils/pushover'
export default defineEventHandler(async event => { const { data: payload } = await getUserSession(event) if (!payload) { throw createError({ statusCode: 401, statusMessage: 'Not Authenticated', }) } if (!payload.sponsor) { throw createError({ statusCode: 403, statusMessage: 'Not Authorized', }) } const { idea } = await readBody(event) await sendPushoverNotification(event, { title: 'Idea from website', message: [`Idea from ${payload.name}:`, '', idea].join('\n'), }) return null})