use of com.nexblocks.authguard.basic.passwordless.PasswordlessMessageBody in project AuthGuard by AuthGuard.
the class SmsPasswordlessSubscriber method onMessage.
@Override
public void onMessage(final Message message) {
if (message.getEventType() == EventType.PASSWORDLESS_GENERATED) {
final PasswordlessMessageBody messageBody = (PasswordlessMessageBody) message.getMessageBody();
final AccountBO account = messageBody.getAccount();
final AccountTokenDO accountToken = messageBody.getAccountToken();
sendEmail(account, accountToken);
}
}
use of com.nexblocks.authguard.basic.passwordless.PasswordlessMessageBody in project AuthGuard by AuthGuard.
the class EmailPasswordlessSubscriber method onMessage.
@Override
public void onMessage(final Message message) {
if (message.getEventType() == EventType.PASSWORDLESS_GENERATED) {
final PasswordlessMessageBody messageBody = (PasswordlessMessageBody) message.getMessageBody();
final AccountBO account = messageBody.getAccount();
final AccountTokenDO accountToken = messageBody.getAccountToken();
sendEmail(account, accountToken);
}
}
use of com.nexblocks.authguard.basic.passwordless.PasswordlessMessageBody in project AuthGuard by AuthGuard.
the class EmailPasswordlessSubscriberTest method onWrongMessageType.
@Test
void onWrongMessageType() {
final AccountTokenDO accountToken = AccountTokenDO.builder().token("token").build();
final AccountBO account = AccountBO.builder().email(AccountEmailBO.builder().email("user@test.net").build()).build();
final PasswordlessMessageBody messageBody = new PasswordlessMessageBody(accountToken, account);
final Message message = Messages.passwordlessGenerated(messageBody).withEventType(EventType.ADMIN);
emailPasswordlessSubscriber.onMessage(message);
Mockito.verify(emailProvider, Mockito.never()).send(Mockito.any());
}
Aggregations