mjrussell / redux-auth-wrapper

A React Higher Order Component (HOC) for handling Authentication and Authorization with Routing and Redux
https://mjrussell.github.io/redux-auth-wrapper
MIT License
2.2k stars 241 forks source link

Using with router5 #218

Open jonaskello opened 6 years ago

jonaskello commented 6 years ago

Is redux-auth-wrapper compatible with router5?

mjrussell commented 6 years ago

It should definitely be possible, that was one the primary reasons for the refactoring in v2. I think you'd write something similar to this redirect. getRouterRedirect looks like it should return router.navigate.

The locationHelperBuilder is maybe a little more tricky, it needs to be an object that returns two functions: getRedirectQueryParam should pull /dashboad out of a url like http://my-app.example.com/login?redirect=%2fdashboard. createRedirectLoc is used to build the object to be passed to the router.navigate function.

Ammonix commented 6 years ago

@mjrussell are you gonna include router5?

mjrussell commented 6 years ago

I dont plan on writing support myself, no. But if someone wants to work on it and submit a PR I'd be happy to review it and try to get it in.