React-OpenIdConnect
React-OpenIdConnect copied to clipboard
Adds the possibility to use complex components
This PR adds the support to use ReactComponents inside the renderNotAuthenticated properties.
Simple example:
// file: ./components/notauthenticated.js
...
export default function NotAuthenticated(props) {
const { onSignIn } = props;
return (<h1 onClick={onSignIn}>Click here to login</h1>);
}
// file: ./pages/home.js
...
import NotAuthenticated from './components/notauthenticated.js';
export default function Page() {
...
return (
<Authenticate
OidcSettings={OidcSettings}
userLoaded={userLoaded}
userunLoaded={userUnLoaded}
renderNotAuthenticated={NotAuthenticated}
>
<div>If you see this you are authenticated.</div>
</Authenticate>
);
}
Hey @bsvveen.
Could you please check this one?
Thank you.