React-OpenIdConnect icon indicating copy to clipboard operation
React-OpenIdConnect copied to clipboard

Adds the possibility to use complex components

Open rluders opened this issue 5 years ago • 1 comments

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>
  );
}

rluders avatar Apr 07 '20 13:04 rluders

Hey @bsvveen.

Could you please check this one?

Thank you.

rluders avatar Apr 15 '20 10:04 rluders