Skip to content

Commit

Permalink
Merge branch 'aquafree-fork' into release-3.4-aquafree
Browse files Browse the repository at this point in the history
  • Loading branch information
JcBernack committed May 10, 2023
2 parents d43ed6b + ad0da2a commit 861db8f
Show file tree
Hide file tree
Showing 7 changed files with 2,351 additions and 499 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

@Service
@Slf4j
Expand Down Expand Up @@ -199,8 +201,19 @@ public void sendActivationEmail(String activationLink, String email) throws Thin

String subject = messages.getMessage("activation.subject", null, Locale.US);

String activationToken = null;
Pattern activationTokenPattern = Pattern.compile("\\?activateToken=(.*)");
Matcher activationTokenPatternMatcher = activationTokenPattern.matcher(activationLink);

while(activationTokenPatternMatcher.find()) {
activationToken = activationTokenPatternMatcher.group(1);
System.out.println("found token: " + activationToken);
}


Map<String, Object> model = new HashMap<>();
model.put("activationLink", activationLink);
model.put("activationToken", activationToken);
model.put(TARGET_EMAIL, email);

String message = mergeTemplateIntoString("activation.ftl", model);
Expand All @@ -227,8 +240,11 @@ public void sendResetPasswordEmail(String passwordResetLink, String email) throw

String subject = messages.getMessage("reset.password.subject", null, Locale.US);

String currentResetPasswordToken = passwordResetLink.split("=")[1];

Map<String, Object> model = new HashMap<>();
model.put("passwordResetLink", passwordResetLink);
model.put("passwordResetToken", currentResetPasswordToken);
model.put(TARGET_EMAIL, email);

String message = mergeTemplateIntoString("reset.password.ftl", model);
Expand Down
16 changes: 8 additions & 8 deletions application/src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
test.message.subject=Test message from [Rocknitive] Suite
activation.subject=[Rocknitive] Account-Aktivierung
account.activated.subject=[Rocknitive] - Account wurde aktiviert
reset.password.subject=[Rocknitive] - Zurücksetzen des Passworts angefragt
password.was.reset.subject=[Rocknitive] - Passwort wurde zurückgesetzt
account.lockout.subject=[Rocknitive] - Account wurde gesperrt
api.usage.state=[Rocknitive] - Account limits
2fa.verification.code.subject=[Rocknitive] - 2FA verification code
test.message.subject=Test message from [HyGenius] Suite
activation.subject=[HyGenius] Account-Aktivierung
account.activated.subject=[HyGenius] - Account wurde aktiviert
reset.password.subject=[HyGenius] - Zurücksetzen des Passworts angefragt
password.was.reset.subject=[HyGenius] - Passwort wurde zurückgesetzt
account.lockout.subject=[HyGenius] - Account wurde gesperrt
api.usage.state=[HyGenius] - Account limits
2fa.verification.code.subject=[HyGenius] - 2FA verification code
528 changes: 428 additions & 100 deletions application/src/main/resources/templates/account.activated.ftl

Large diffs are not rendered by default.

518 changes: 428 additions & 90 deletions application/src/main/resources/templates/account.lockout.ftl

Large diffs are not rendered by default.

658 changes: 557 additions & 101 deletions application/src/main/resources/templates/activation.ftl

Large diffs are not rendered by default.

583 changes: 483 additions & 100 deletions application/src/main/resources/templates/password.was.reset.ftl

Large diffs are not rendered by default.

531 changes: 431 additions & 100 deletions application/src/main/resources/templates/reset.password.ftl

Large diffs are not rendered by default.

0 comments on commit 861db8f

Please sign in to comment.