When auth0 is using the provided callback it usually has the format https://webiste.com/#access_token=abc
react-router interpret that as https://webiste.com/#/access_token=abc and complains that there is no route access_token.
Is there any way around that?
I know there is browserHistory, but that seems to require a massive rewrite of my backend.
@Moezalez
I had a same problem but you can work around by parsing hash and edit/clear hash before render router dom.
example code below
const lock = new Auth0Lock('client_key','domain');
var idToken = localStorage.getItem('userToken');
const authHash = lock.parseHash(window.location.hash);
if (authHash) {
if (authHash.id_token) {
idToken = authHash.id_token
localStorage.setItem('userToken', authHash.id_token);
location.href = '/#/';
}
if (authHash.error) {
console.log("Error signing in", authHash);
}
}
ReactDOM.render(
<Provider store={store}>
<Router history={history} routes={routes} />
</Provider>
, document.getElementById('root')
);
Since the release of Auth0-lock v10 this workaround seems not to work anymore?
I'm having the same issue. Could someone please kindly confirm how to integrate auth0 with RR 2.4x?
I'm experiencing the same warning. Will this issue be addressed again? The example from Auth0 is using react-router: https://auth0.com/docs/quickstart/spa/react/01-login
Most helpful comment
I'm having the same issue. Could someone please kindly confirm how to integrate auth0 with RR 2.4x?