Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
if(!msg.payload.orbita) {
    msg.payload.orbita = {};
}

if(!msg.payload.orbita.directive) {
    msg.payload.orbita.directive = [];
}

msg.payload.orbita.directive.push({
    type: 'login', 
    successUtterance: 'success', 
    html: `<button class="smrtBtn chattheme chatthemeborderbuttonsloginButton">Login</button>`
})
//
msg.payload.orbita.logoutUrls = [{
//     'type': 'window', 
//     url:'http://localhost:3030/oauth/logout?'
// }]; 
msg.payload.orbita.state = "Login"

return msg;state = "Login"

return msg;

Customizing the login button

You can customize the login button by using CSS to style it.

...

Go to the Bot Manager flow > Bot View template Node > Custom CSS tab, and place the below code.

Code Block
.loginButton {
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  background-color: #4CAF50;
}

...

Note the class name loginButton should be the same as used in the Login Directive code.

How to get inline login

You can make use of the HTML directive to get inline login in the Chatbot. See, HTML Directive

...

The Login Directive and the Inline Login are combined in a single flow in the below attachment.

Attachments
previewfalseuploadfalse
oldfalse
patterns*.json

...