What you were expecting:
A custom route, like /forgot-password should be accessible without permissions.
What happened instead:
Redirects to /login when not authenticated.
Steps to reproduce:
When <Resource>s are declared as
<Admin customRoutes={[鉁傦笍]}>
{(permissions) => [
<Resource />
]}
</Admin>
getPermissions() gets executed, which will, when it rejects, call logout(), making it impossible to tell React Admin to not to redirect to the loginUrl but stay on the custom route.
This is not the case when permissions are not exposed to the <Resource>s as initializeResources() isn't called, so this works as advertised:
<Admin customRoutes={[鉁傦笍]}>
<Resource />
</Admin>
Related code:
See above.
Other information:
This, apparently, wasn't the case with 2.x, so I decided not to reopen #3224.
Environment
3.0.32.???16.12.0Hm, I think I might have missed something, so I'll reopen when I can figure out what's off...
@zeppelin Did you figure this out? We're not able to create custom routes that don't require permission checks.
@zeppelin Feel free to open a new issue, your feedback would be much appreciated :)
@RWOverdijk @Kmaschta thank you, I did figure it out!
@zeppelin Nice!
Would you mind share with us your findings, so that next readers might be helped a bit? :)
Hahahaha, @zeppelin I wasn't just asking because I was curious :p I was asking because I'd like to know how you did it. You know, to help other people.
How did you solve it?
@RWOverdijk I was missing something. Returned wrong values from auth provider, as I recall...
That's not very helpful 馃槃 But thanks anyway!

@RWOverdijk I honestly can't recall what was it exactly. It had to do with screwing up something in the auth provider, not at the route definitions.
Most helpful comment