Dimitri Kopriwa
Dimitri Kopriwa

Reputation: 14385

react-admin: what is authParams for?

I am using react-admin and I am looking at the documentation page for creating page with permissions

The example shows:

const MyPageWithPermissions = ({ location, match }) => (
    <WithPermissions
        authParams={{ key: match.path, params: route.params }}
        // location is not required but it will trigger a new permissions check if specified when it changes
        location={location}
        render={({ permissions }) => <MyPage permissions={permissions} /> }
    />
);

export default MyPageWithPermissions;

First of all:

I would like to know:

Upvotes: 2

Views: 281

Answers (1)

Gildas Garcia
Gildas Garcia

Reputation: 7066

Those are for custom params you'd like to check in your authProvider. They will be passed to it when WithPermissions calls it.

They are optional though as you can see in the next example for a custom menu

Upvotes: 1

Related Questions