Validate login credentials using js