Not being redirected according to OAuth2 flow on web app

My app is working well when run locally, but on deployment, I get the following message on Streamlit log rather than being redirected.


I am using OAuth2.0 flow. Below is the snippet of my code which handles authentiation

    creds = None
    if os.path.exists('token.pickle'):
        with open('token.pickle', 'rb') as token:
            creds = pickle.load(token)
    if not creds or not creds.valid:
        if creds and creds.expired and creds.refresh_token:
            creds.refresh(Request())
        else:
            flow = InstalledAppFlow.from_client_secrets_file(
                'credentials.json', SCOPES)
            creds = flow.run_local_server(port=8080)
        with open('token.pickle', 'wb') as token:
            pickle.dump(creds, token)
    if creds and creds.expired and creds.refresh_token:
        creds.refresh(Request()) 
        with open('token.pickle', 'wb') as token:
            pickle.dump(creds, token)

hey hi ! welcome to community you check out this post

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.