Okta PKCE Redirect Infinite Loop React SPA w/React Router

Hello,
I am using React v16.13.1 with React-Router v5.2.0. I’ve been facing an issue with using the hosted test to redirect my users to login and return back to my application.

First off here is the React Router Set up

<Security  {...oidc}>
                <Switch>

                  <SecureRoute exact path="/">

                    <div className="overflow-hidden">

                      <DashboardProvider>

                        <Dashboard />

                      </DashboardProvider>

                    </div>

                  </SecureRoute>

                  <Route path="/implicit/callback" component={LoginCallback} />

                  <Route path="/error">

                    <ErrorLoading />

                  </Route>

          </Security>

Basically every time I click on a secure route, basically ‘/’ it ends up throwing an endless loop of
[okta-auth-sdk] WARN: saveMeta: PKCE codeVerifier exists in sessionStorage. This may indicate an auth flow is already in progress.
in my console in the browser. Now this won’t stop the redirect, but it will only stop since the browser will then throttle the navigation and it seems like it resolves at the end. For browsers like firefox it does not throttle and just crashes the browser. As well as this I have PKCE enabled in the config as well as unchecked implicit grant, Is my routing off or something? why does this even happen like this.

1 Like

Are your secure routes attempting to make an authorize call? What is the sequence of network events that you see? Do you ever see a successful authorize request return the authorization code?

Hi Andrea,
3.0.9 broke our production webapp; it is now working. Thank you!

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