authts/react-oidc-context

Naming Inconsistency: "OnRedirecting" vs. "onRedirecting"

pengqun opened this issue · 1 comments

In the project README, under the section "Protect a route," the following example code is provided:

export default withAuthenticationRequired(PrivateRoute, {
  onRedirecting: () => (<div>Redirecting to the login page...</div>)
});

However, this code does not compile because the onRedirecting prop is named "OnRedirecting" (with a capital "O") in the source code (src/withAuthenticationRequired.tsx):

export interface WithAuthenticationRequiredProps {
    /**
     * Show a message when redirected to the signin page.
     */
    OnRedirecting?: () => JSX.Element;

    /**
     * Allows executing logic before the user is redirected to the signin page.
     */
    onBeforeSignin?: () => Promise<void> | void;

    /**
     * Pass additional signin redirect arguments.
     */
    signinRedirectArgs?: SigninRedirectArgs;
}

thanks for reporting

we can fix the affected code (OnRedirecting -> onRedirecting) in the next major version.

I made it upper case because it returns a JSX.Element. So lets keep the code and fix the documentation...