File tree Expand file tree Collapse file tree 5 files changed +19
-4
lines changed
src/main/java/app/fyreplace/api/emails Expand file tree Collapse file tree 5 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -47,11 +47,13 @@ public abstract class EmailBase extends Mail {
4747 @ Context
4848 UriInfo uriInfo ;
4949
50+ protected Email email ;
51+
5052 private boolean customDeepLinks ;
5153
5254 private String randomCodeClearText ;
5355
54- private Email email ;
56+ protected abstract String path () ;
5557
5658 protected abstract String action ();
5759
@@ -87,7 +89,7 @@ protected String getRandomCode() {
8789 protected String getLink () {
8890 return UriBuilder .fromUri (appFrontUrl .toString ())
8991 .scheme (customDeepLinks ? appFrontCustomScheme : appFrontUrl .getScheme ())
90- .path (email . user . active ? "/login" : "/register" )
92+ .path (path () )
9193 .queryParam ("action" , action ())
9294 .fragment (getRandomCode ())
9395 .build ()
Original file line number Diff line number Diff line change 66
77@ RequestScoped
88public final class EmailVerificationEmail extends EmailBase {
9+ @ Override
10+ protected String path () {
11+ return "/settings/emails" ;
12+ }
13+
914 @ Override
1015 protected String action () {
1116 return "email" ;
Original file line number Diff line number Diff line change 55import jakarta .enterprise .context .RequestScoped ;
66
77@ RequestScoped
8- public final class UserActivationEmail extends EmailBase {
8+ public final class UserActivationEmail extends UserEmailBase {
99 @ Override
1010 protected String action () {
1111 return "connect" ;
Original file line number Diff line number Diff line change 55import jakarta .enterprise .context .RequestScoped ;
66
77@ RequestScoped
8- public final class UserConnectionEmail extends EmailBase {
8+ public final class UserConnectionEmail extends UserEmailBase {
99 @ Override
1010 protected String action () {
1111 return "connect" ;
Original file line number Diff line number Diff line change 1+ package app .fyreplace .api .emails ;
2+
3+ public abstract class UserEmailBase extends EmailBase {
4+ @ Override
5+ protected String path () {
6+ return email .user .active ? "/login" : "/register" ;
7+ }
8+ }
You can’t perform that action at this time.
0 commit comments