add FRONTEND_URL and password-reset implementation

This commit is contained in:
Philipp Dormann 2024-12-11 17:53:50 +01:00
parent f6da5ede9a
commit b0bd323bee
Signed by: philipp
GPG Key ID: 3BB9ADD52DCA4314
6 changed files with 624 additions and 31 deletions

View File

@ -4,4 +4,5 @@ SMTP_USER="project.1"
SMTP_PASS="secret.1" SMTP_PASS="secret.1"
EMAIL_FROM="noreply@lauf-fuer-kaya.de" EMAIL_FROM="noreply@lauf-fuer-kaya.de"
EMAIL_REPLYTO="info@lauf-fuer-kaya.de" EMAIL_REPLYTO="info@lauf-fuer-kaya.de"
REDIS_URL=redis://localhost:6379 REDIS_URL=redis://localhost:6379
FRONTEND_URL="https://run.lauf-fuer-kaya.de"

View File

@ -42,6 +42,9 @@ emailRouter.post('/', zValidator('json', sendEmailSchema), async (c) => {
const dataURL = await generateBarcodeDataURL(data.barcode_content); const dataURL = await generateBarcodeDataURL(data.barcode_content);
data.barcode_url = dataURL; data.barcode_url = dataURL;
} }
if (templateName === "password-reset") {
data.reset_link= `${process.env.FRONTEND_URL}/reset/${(Buffer.from(data.token)).toString("base64")}`
}
await emailService.sendEmail({ await emailService.sendEmail({
to, to,
subject, subject,

File diff suppressed because one or more lines are too long

View File

@ -1,13 +1,17 @@
Anfrage zum Zurücksetzen des Passworts Hallo 👋
Hallo {{name}}, Wir haben eine Anfrage zum Zurücksetzen deines Passworts erhalten.
Verwende den folgenden Link, um ein neues Passwort zu erstellen:
{{reset_link}}
Wir haben eine Anfrage zum Zurücksetzen Ihres Passworts erhalten. Verwenden Sie den folgenden Link, um ein neues Passwort zu erstellen: Falls du diese Anfrage nicht gestellt hast, ignoriere bitte diese E-Mail.
{{resetLink}}
Dieser Link läuft in {{expiresIn}} ab. Sportliche Grüße 🏃‍♂️
Dein Team Lauf für Kaya!
Falls Sie diese Anfrage nicht gestellt haben, ignorieren Sie bitte diese E-Mail oder kontaktieren Sie den Support, wenn Sie Bedenken haben. -
Mit freundlichen Grüßen, Lauf für Kaya!
Ihr Support-Team Powered by ODIT.Services (https://odit.services)
Impressum: https://lauf-fuer-kaya.de/impressum/
Datenschutzerklärung: https://lauf-fuer-kaya.de/datenschutz/

File diff suppressed because one or more lines are too long

View File

@ -1,13 +1,17 @@
Password Reset Request Hello 👋
Hello {{name}}, We received a request to reset your password.
Use the following link to create a new password:
{{reset_link}}
We received a request to reset your password. Use the following link to create a new password: If you didn't request this password reset, please ignore this email.
{{resetLink}}
This link will expire in {{expiresIn}}. Sporty Greetings 🏃‍♂️
Your Team Lauf für Kaya!
If you didn't request this password reset, please ignore this email or contact support if you have concerns. -
Best regards, Lauf für Kaya!
Your Support Team Powered by ODIT.Services (https://odit.services)
Imprint: https://lauf-fuer-kaya.de/impressum/
Privacy Policy: https://lauf-fuer-kaya.de/datenschutz/