Login screen does not work

I replaced my hard disk and installed Leap 15 from scratch. It was working. Then I came in this morning and I got a message that the screen lock could not be unlocked and I should run some program in console mode to unlock it.
But now when I boot, I get the Plasma login screen. I enter my password, and click the login button, and nothing happens. The same thing happens with Gnome.
How do I debug this?

Start by logging in as root on vtty 2-6. (Ctrl-Alt-Fn), then

journalctl -b | grep ailed

There should be messages there to suggest where else to look. You might want to try checking to see if everything installed properly:

zypper ve

If that didn’t help, try updating:

zypper ref; zypper -v up

Maybe more messages at boot time would help. At the Grub menu, use the e key to edit the kernel cmdline, appending plymouth.enable=0 and removing quiet and splash=silent. When you post back, tell us about your hardware.

inxi -v4

would be a good start, but you might need to first

zypper in inxi

Switching login managers might help:

zypper rm sddm gdm; zypper in lightdm