commit
02d6e41ce3
2 changed files with 16 additions and 2 deletions
|
@ -623,6 +623,7 @@ public class LoginActionsService {
|
|||
if (clientSession.getAction().equals(ClientSessionModel.Action.RECOVER_PASSWORD.name())) {
|
||||
String actionCookieValue = getActionCookie();
|
||||
if (actionCookieValue == null || !actionCookieValue.equals(userSession.getId())) {
|
||||
session.sessions().removeClientSession(realm, clientSession);
|
||||
return session.getProvider(LoginFormsProvider.class)
|
||||
.setSuccess(Messages.ACCOUNT_PASSWORD_UPDATED)
|
||||
.createInfoPage();
|
||||
|
@ -657,6 +658,7 @@ public class LoginActionsService {
|
|||
|
||||
String actionCookieValue = getActionCookie();
|
||||
if (actionCookieValue == null || !actionCookieValue.equals(userSession.getId())) {
|
||||
session.sessions().removeClientSession(realm, clientSession);
|
||||
return session.getProvider(LoginFormsProvider.class)
|
||||
.setSuccess(Messages.EMAIL_VERIFIED)
|
||||
.createInfoPage();
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.icegreen.greenmail.util.ServerSetup;
|
|||
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import javax.mail.internet.MimeMessage.RecipientType;
|
||||
import javax.mail.internet.MimeMultipart;
|
||||
|
||||
public class MailServer {
|
||||
|
||||
|
@ -22,9 +23,20 @@ public class MailServer {
|
|||
|
||||
if (greenMail.waitForIncomingEmail(Long.MAX_VALUE, c + 1)) {
|
||||
MimeMessage message = greenMail.getReceivedMessages()[c++];
|
||||
System.out.println("-------------------------------------------------------");
|
||||
System.out.println("Received mail to " + message.getRecipients(RecipientType.TO)[0]);
|
||||
System.out.println();
|
||||
System.out.println(message.getContent());
|
||||
if (message.getContent() instanceof MimeMultipart) {
|
||||
MimeMultipart mimeMultipart = (MimeMultipart) message.getContent();
|
||||
for (int i = 0; i < mimeMultipart.getCount(); i++) {
|
||||
System.out.println("----");
|
||||
System.out.println(mimeMultipart.getBodyPart(i).getContentType() + ":");
|
||||
System.out.println();
|
||||
System.out.println(mimeMultipart.getBodyPart(i).getContent());
|
||||
}
|
||||
} else {
|
||||
System.out.println();
|
||||
System.out.println(message.getContent());
|
||||
}
|
||||
System.out.println("-------------------------------------------------------");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue