@mk, It has been a long while since I dealt with LDAP.
From memory I am pretty sure that we did another / 2nd query that required a successful authentication.
(again from memory) - I think it was get the groups for the logged in user.
But hopefully you'll think of / know of an appropriate query...
Anyway - then check that query's result / resultcode - to determine if the login was successful.
If so - great
If not - show your error.
(JS alert / bootstrap error message / your JS library of choice / etc)