For months my phone has randomly been turning on and off. A few days ago it did it again (while I was reading something on safari) and got stuck in a bootloop. I connected it to iTunes in DFU mode and it let me halfway solve the bootloop by attempting to update the iOS (Recommended by iTunes) . I saw my old lockscreen, filled out some info for the phone like wifi, apple id pass and other things and eventually it told me to slide to upgrade. I have tried to slide to upgrade many times but it always takes me back to the slide to upgrade page and I can't do anything else on my phone.

Other things:

This phone has a passcode

This phone was jailbroken but I believe a newer iOS put itself on my phone on it's own after

The phone always used to randomly ask for my apple id pass and I had no idea what it was for. I gave it one time and it continued to ask.

What can I do to salvage everything that I have on this phone or complete the updating process? Please answer if you have any idea. Thank you so much.