The legal risks are overstated, but people blithely saying "they will look at devices, not the WiFi and the ISP connection" are at once right and very wrong.
They are right: you cannot be prosecuted merely because your network connection carried bad shit without evidence that it was downloaded onto devices you control. However, were it to emerge that your network connection was being used for bad shit - remember, assuming the OP is a normal person with a normal Internet connection, their neighbours will appear to the outside world to be using the same IP number as they are, because for practical purposes no home users have more than one IP numbers - that would be more than sufficient grounds for the police to search your house and take away all the IT for forensic examination. You might even get it back.
As a nice test for your personal disaster recovery strategy: if the police took away all your phones, iPads, laptops, desktops and portable storage devices, how fucked is your life? Yeah, you won't be prosecuted and you certainly won't be convicted. But how fucked is your life? And since the main reason the general public think this happens is child pornography, and the execution of search warrants on your house is neither quiet nor secret, how fucked is your life?
you cant get someone information by access their wifi
It's one less barrier. I teach and research computer security, and I am with some reasonable grounds confident that my laptop would withstand attacks by most things this side of very serious targeted actors (ie, didn't just want to compromise someone, but wanted to compromise explicitly me and willing to devote serious resources to doing so).
So I happily use coffee shop and hotel wifi to do banking, although out of habit more than anything more concrete I tend to use a VPN back to home if I am nervous.
I still wouldn't give my home WiFi credentials to randoms.
For a start off, I don't trust the other kit in my house any further than I can throw it and have segmented my home network so that devices I don't really control which don't need access to anything other than the outside word (televisions, door bells, lighting controllers, Alexa, etc) are on networks firewalled off from devices that contain useful information (laptops, desktops, phones). I haven't yet brought up a separate network for our employers' machines, but I'm close to it.
I have a guest network for visitors, which right now I just change the credentials on once they have left, but I am moving towards either hotel-style 24 hour access or issuing usernames and passwords to them individuals.
I can do this because, nerd in the trade, my home network is built out of cast-off and repurposed enterprise kit, and is basically a scale model of a large enterprise. I also can justify the effort as "work", and we have joked about having students take a field trip to my house.
But if I were advising normal people without the time, inclination or equipment to build a miniature secure network and do an informal 27001 exercise on their house? For fuck's sake, don't share your WiFi credentials. Yes, if you run things properly, don't click through the warnings and generally behave like the IT manager's pet, you'll be fine. If like most people you're a bit casual, a bit sloppy and don't worry too much about those badly worded warnings about incorrect certificates and the like, then the risk is non-zero. Why take it?