I have this code where I set the login_hint param dynamically & coming from user input. But when it redirect to /authorize url & i inspect it then the login_hint param is always empty. I can see that the login_hint param is set in the console message when I input any email.
import React, {useState, useEffect} from 'react';
import {createRoot} from 'react-dom/client';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import {Auth0Provider} from '@auth0/auth0-react';
import history from './utils/history';
import {getConfig} from './config';
import {EmailProvider, useEmail} from "./components/EmailContext";
const onRedirectCallback = (appState) => {
console.log('onRedirectCallback called');
history.push(appState && appState.returnTo ? appState.returnTo : window.location.pathname);
};
const config = getConfig();
// Custom wrapper component that includes an input for login_hint
const Auth0ProviderWithConfig = ({children}) => {
const {email, setEmail} = useEmail();
const providerConfig = {
domain: config.domain,
clientId: config.clientId,
onRedirectCallback,
authorizationParams: {
login_hint: email,
redirect_uri: window.location.origin,
...(config.audience ? {audience: config.audience} : null),
},
};
console.log(providerConfig.authorizationParams)
return (
<Auth0Provider {...providerConfig}>
{children}
</Auth0Provider>
);
};
const root = createRoot(document.getElementById('root'));
root.render(
<EmailProvider>
<Auth0ProviderWithConfig>
<App/>
</Auth0ProviderWithConfig>,\
</EmailProvider>
);
serviceWorker.unregister();
Any help would be appreciated.