import async from 'async' import mailer from '../config/mailer' import { dbController } from './dbController' const lang = 'DE' const publicController = { showRegistrationPage: function (res: any) { res.render(lang + '/account/registration') }, showContactPage: function (req: any, res: any) { res.render(lang + '/account/contact', { user: req.user }) }, showForgotPwdPage: function (req: any, res: any) { res.render(lang + '/account/forgotPwd', { user: req.user }) }, showResetToken: async function (req: any, res: any) { const user = await dbController.getUserByToken(req.params.token) if (user) { res.render(lang + '/account/reset') } else { res.flash('error', 'Der Schlüssel zum zurücksetzen des Passworts ist ungültig oder abgelaufen.') res.redirect('/account/forgotPwd') } }, sendContactMessage: function (req: any, res: any) { const emailAddress = req.body.inputEmail const supportAddress = 'support-transfer@hft-stuttgart.de' const inputName = req.body.name const inputContent = req.body.message const emailSubject = 'Ihre Anfrage an das Transferportal' const emailContent = '