ci: migrate GitHub actions to Gitea actions
Deploy CV Site (andreknie.de) / deploy (push) Canceled after 0s
Deploy CV Site (andreknie.de) / deploy (push) Canceled after 0s
This commit is contained in:
@@ -19,18 +19,19 @@ router.post('/', contactLimiter, antiSpam, async (req, res) => {
|
||||
return res.status(400).json({ errors })
|
||||
}
|
||||
|
||||
const token = createToken('contact', { name, email, message }, 24)
|
||||
const token = await createToken('contact', { name, email, message }, 24)
|
||||
await sendConfirmationEmail(email, 'contact', token)
|
||||
res.status(201).json({ ok: true, message: 'Bestätigungs-E-Mail gesendet.' })
|
||||
})
|
||||
|
||||
router.post('/confirm/:token', async (req, res) => {
|
||||
const entry = verifyToken(req.params.token)
|
||||
router.get('/confirm/:token', async (req, res) => {
|
||||
const baseUrl = process.env.BASE_URL || ''
|
||||
const entry = await verifyToken(req.params.token)
|
||||
if (!entry) {
|
||||
return res.status(410).json({ error: 'Link abgelaufen oder ungültig.' })
|
||||
return res.redirect(baseUrl + '/bestaetigung?status=error')
|
||||
}
|
||||
await sendStakeholderNotification('contact', entry.data)
|
||||
res.json({ ok: true, message: 'Nachricht wurde weitergeleitet.' })
|
||||
res.redirect(baseUrl + '/bestaetigung?status=success')
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
Reference in New Issue
Block a user