Why do you go to login page if the user is logged out in the confirmed page? I think that page should work regardless.

And the on page load of confirmed seems to be doing a lot with two or more conditions to change the verified flag. I am sure some of these are coming later maybe? (Stripe customer ID?)

You should do some checks later and change this logic a little bit.