Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prop type validation warnings with redirection components #320

Closed
cheets opened this issue Oct 14, 2019 · 0 comments · Fixed by #321
Closed

Prop type validation warnings with redirection components #320

cheets opened this issue Oct 14, 2019 · 0 comments · Fixed by #321

Comments

@cheets
Copy link
Contributor

cheets commented Oct 14, 2019

Issue and Steps to Reproduce

Supplying custom redirect components for AuthenticationProvider causes prop type validation warnings. Currently they are defined as PropTypes.node however correct one would be PropTypes.elementType as that accepts functional components as well. Here's a link to the PR where elementType was added.

import { AuthenticationProvider, oidcLog } from "@axa-fr/react-oidc-context";
import oidcConfiguration from "./configuration";
import NotAuthorized from "../auth/not-authorized";
import NotAuthenticated from "../auth/not-authenticated";
import Authenticating from "../auth/authenticating";
import CallbackComponent from "../auth/callback-component";

<AuthenticationProvider
        configuration={oidcConfiguration}
        logger={console}
        loggerLevel={oidcLog.DEBUG}
        isEnabled={true}
        notAuthorized={NotAuthorized}
        notAuthenticated={NotAuthenticated}
        authenticating={Authenticating}
        callbackComponentOverride={CallbackComponent}
      >

All my custom redirects are similar to this:

// ./auth/authenticating.jsx
import React from "react";

const Authenticating = () => {
  return (
    <div>
      <h2>Redirecting to authentication service</h2>
      <p>Moment please...</p>
    </div>
  );
};

export default Authenticating;

Versions

3.0.1-alpha.0

Screenshots

oidc-prop-type-validation-errors

Expected

No errors :)

Actual

Failed prop type warnings.

Additional Details

I'll provide a PR with the fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant