Change Login Error Based on Disabled Account

Good day all.  Is it possible to have a different login error message if an account exists and is disabled?  We disable accounts after a specified number of days of inactivity.  I would like to have a unique message for people trying to log in and their account is disabled.  Thank you for your help.

Parents
  • Hi Nathan,

    you can change the used locale strings in the codetree but I assume this will not cover this specific use case (already existing account).

    But there is an alternative option: System Events! You can display your own message with a custom Method that is fired "onFailedLogin". 

    You can first check the user and then fire a 'newError' with your specific message if your conditions apply. Otherwise the regular error message will be returned.

    -

    I have to admit that System Events for me always feel some kind of "sus". 

    Reason: System Events get and execute something inside the database -  but outside the database. I always wonder if this is potential source for trouble. So pay attention that nothing can be injected into the Method. But maybe it's really just an 'inner feeling' on my part, I never got the opportunity to discuss the idea.

  • 0 オフライン in reply to AngelaIp

    Angela,

    As always, you rock!  Thanks for this information, I will look into this.

Reply Children