diff --git a/src/Provider.tsx b/src/Provider.tsx index 2995241..9c9b735 100644 --- a/src/Provider.tsx +++ b/src/Provider.tsx @@ -44,13 +44,22 @@ export const Provider = ({ dispatch({ type: "REVOKE" }); }; - const { redirect, scopes, - client + client, + ...config } = authorizationManagerConfigruation; + /** + * Remove events from the configuration object. + * + * @todo We could probably support dispatching user-provided events + * in our `handleAuthenticated` and `handleRevoke` functions, it's just + * not clear if it would be necessary. + */ + delete config?.events; + useEffect(() => { const i = authorization.create({ redirect, @@ -61,6 +70,7 @@ export const Provider = ({ authenticated: handleAuthenticated, revoke: handleRevoke, }, + ...config, }); setInstance(i);