1

Hoping this is possible. I want to split the username and password error message to return it separately depending whether it is username or password that is incorrect and not just a the generic (Invalid username or password) message. How do I go about this? I don't require answers as to whether it is more secure or not just whether it is possible.

Cheers

5
  • Are you hoping to do this on the main craft login page or a custom form? Apr 16 '15 at 14:44
  • @AaronBerkowitz Custom form.
    – Lettie
    Apr 16 '15 at 15:10
  • I don't believe there is a built-in way. If you take a look at the UserSessionService, you'll see that messages are returned based on an error code. When a username and password combination fail, it triggers this single message to be returned. Apr 16 '15 at 15:30
  • @AaronBerkowitz hmmm looks like that is the default message and there is no code for just username or password error although on the registration form it does split the 2 input fields. I wonder if there is a way of extending this with a plugin?
    – Lettie
    Apr 16 '15 at 16:11
  • Yeah, nothing's stopping you from making a plugin that provides it's own login implementation. @AaronBerkowitz - Mind adding that as an answer?
    – Brad Bell
    Apr 16 '15 at 17:47
1

There is not a built-in way. If you take a look at the UserSessionService, you'll see that messages are returned based on an error code. When a username and password combination fail, it triggers this single message to be returned.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.