iPhone asks for iCloud password on power charge Whenever I plug my iPhone to charge it, iCloud asks me to re-enter my password. How can I fix this?

I'm using iOS 11.4.
Resetting the settings has solved the problem.