/**
* Prepare to send a message back to the client, informing it that a successful login has
* been performed.
*/
Message successfulMsg = MessageBuilder.createConversation(message)
.subjectProvided()
.command(SecurityCommands.SuccessfulAuth)
.with(SecurityParts.Roles, authSubject.toRolesString())
.with(SecurityParts.Name, name).getMessage();
try {
// TODO: Still used? Take a look at MetaDataScanner.getProperties() instead
ResourceBundle bundle = ResourceBundle.getBundle("errai");
String motdText = bundle.getString("errai.login_motd");
/**
* If the MOTD is configured, then add it to the message.
*/
if (motdText != null) {
successfulMsg.set(MessageParts.MessageText, motdText);
}
}
catch (Exception e) {
// do nothing.
}
/**
* Transmit the message back to the client.
*/
successfulMsg.sendNowWith(bus);
}
catch (LoginException e) {
/**
* The login failed. How upsetting. Life must go on, and we must inform the client of the
* unfortunate news.