Login credential validation moved to JS