Custom text when authentication failed

Hello, I’m trying the Actions options to prevent that users log in on anothe applications. Works very well, but I want to change the text that it’s show on authentincation failed.

The action that I’m using is:

exports.onExecutePostLogin = async (event, api) => {

if (event.client.name === "Some App" && event.user.email=="some@mail.com") {
    api.access.deny("Usuario no autorizado para usar Some App);
  }
}

The deny text it’s showing in the Logs but in the browser I get this (please see the attached image):

There was an error trying to log you in: ''

It’s is possible to change that?

Hey there @gwettstein ~ Did you ever get this working?

You should definitely be able to return a custom URL query String param here. I just set up a quick test action using the same code you shared and can confirm it’s possible (See below). I’d expect you to get a different error message so I assume the missing " in your custom error message is just a typo on this end.

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.