Serial read SSID and PASSWORD WiFI connection failed in ESP32
Is your Serial Monitor setting set to "Both NL and CR"? Change it to "Newline" should works. 

What happened is if your Serial Monitor has a setting of "Both NL and CR", when your press Enter, it generates a \r\n, the Serial.readBytesUntil(10, ssid, 50) picked up that \r at the end of the array, when you use it as SSID, it is not a valid SSID.