Express-served react app - `Cannot GET /implicit/callback`

I have a react app served by an express server. I’ve successfully got the create-react-app react sample going and am now trying to port it over to my app (which which the other difference is I use redux). However, whatever was working with my CRA’s dev server isn’t working out on express, because despite having

const Root = () => (
  <Provider store={store}>
    <Router>
      <Security
        issuer={oktaConfig.oidc.issuer}
        client_id={oktaConfig.oidc.clientId}
        redirect_uri={oktaConfig.oidc.redirectUri}
      >
        <Route path="/" exact component={Home} />
        <Route path="/implicit/callback" component={ImplicitCallback} />
        <SecureRoute path="/myApp" component={myApp} />
      </Security>
    </Router>
  </Provider>
)

and having integrated the Home component from the example. When I click the login button, I am directed to http://localhost:8080/implicit/callback#id_token={long hash} and get Cannot GET /implicit/callback. I’m not sure if this is a sort of disagreement between using React router and express routing, as I have just introduced react router in my app for the purpose of the okta HOC. Is there something I am missing with how an express/react app ought to be configured on the backend?

Thanks,
Thomas

1 Like

Hey Thomas,

Were you find able to find a solution to this issue? I am currently facing the same problem, and it looks like we have a similar structure for the React component.

Please let me know if you find a way!

1 Like