You are probably running into Deprecation of HTTP Basic Auth and OAuth 1.0a · Issue #867 · openstreetmap/operations · GitHub (see OAuth 1.0a and HTTP Basic Auth shutdown for discussion on this forum).
I have no clue what version of JOSM you are running, but you should probably update if you only see Use Basic Authentication
and Use OAuth 1.0
. If you see Use OAuth 2.0
as an option (and it should be the default with recent versions of JOSM), then there is something else going on.
With all that said, you did say “I didn’t use JOSM for a long time”, so you probably just need to update JOSM.
If you are on Windows and used the Windows installer, you may need to uninstall JOSM and reinstall JOSM – the installer got changed awhile back, and I don’t know if your install predates that or not.
Downloads for JOSM can be found at https://josm.openstreetmap.de/ .