This question already has an answer here:
Have been using Elementary (latest) for a week and running well. Default admin user as me. After installing some new software, next time I went to start, I get the login screen which does not accept my pwd, but recycles back to login screen. However, if I go to bash, and sudo my username and password work perfectly. If I go to recovery mode that has not helped but I dont know how to reset the Xorg file as trying X -config does not work.
To summarise, there is a login screen whereas before I was logged in automatically, and the login screen will not accept me, but accepts guest login only.