Moved password checking in javascript.