How to reload without using --autoreload for authentication flow

I need to reload the served file again when an error occurs. My practices were correct with --auto-reload, but now that I need to remove it. I need to programmatically reload the page on the served app. Please help.
This is what I am receiving and in need to reload properly for the authentication flow.

Error Message: OAuth state mismatch. Please restart the authentication flow.