Skip to content

Commit

Permalink
fix password reset
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Feb 23, 2025
1 parent 8c326be commit b009587
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/lib/i18n/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const translations: Translations = {
weakPassword: 'Bitte wähle ein stärkeres Passwort.',
tooManyRequests: 'Zu viele Anfragen.',
failedToSendVerificationEmail: 'E-Mail zur Verifikation konnte nicht gesendet werden.',
failedToSendPasswordResetEmail: 'E-Mail zum Passwortzurücksetzen konnte nicht gesendet werden.',
accountDoesNotExist: 'Nutzerkonto existiert nicht.',
invalidPassword: 'Ungültiges Passwort.',
new: 'Neu hier? <a href="/account/signup" class="link">Erstelle ein neues Nutzerkonto!</a>',
Expand Down
3 changes: 2 additions & 1 deletion src/lib/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const translations: Translations = {
emailAlreadyRegistered: 'E-Mail already registered.',
weakPassword: 'Weak password.',
tooManyRequests: 'Too many requests.',
failedToSendVerificationEmail: 'Failed to send the verification e-mail',
failedToSendVerificationEmail: 'Failed to send the verification e-mail.',
failedToSendPasswordResetEmail: 'Failed to send the password reset email.',
accountDoesNotExist: 'Account does not exist.',
invalidPassword: 'Invalid password.',
new: 'New here? <a class="link" href="/account/signup">Create an account!</a>',
Expand Down
1 change: 1 addition & 0 deletions src/lib/i18n/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type Translations = {
weakPassword: string;
tooManyRequests: string;
failedToSendVerificationEmail: string;
failedToSendPasswordResetEmail: string;
accountDoesNotExist: string;
invalidPassword: string;
new: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ export const actions: Actions = {
}

try {
await sendMail(PasswordReset, 'Email Verification', email, {
code: user.emailVerificationCode,
await sendMail(PasswordReset, 'Passwort zurücksetzen', email, {
code: user.passwordResetCode,
name: user.name,
email
});
} catch {
return fail(500, { msg: msg('failedToSendVerificationEmail'), email });
}

return redirect(302, '/reset-password');
return redirect(302, '/account/reset-password');
}
};

0 comments on commit b009587

Please sign in to comment.