OperationCode / operationcode_frontend

Front-end repository for live site. Please go to `front-end` repo to contribute instead.
https://operationcode.org
MIT License
101 stars 223 forks source link

Redirect to referral path on Login, if it exists #1023

Closed jjhampton closed 5 years ago

jjhampton commented 5 years ago

Issue Resolved

Fixes #997

jjhampton commented 5 years ago

@kylemh I went ahead and took a crack at this, it looks like React Router supports some of what we want to do with little extra work added. Just passing along the pathname of the referring page (the page we were attempting to reach) to the Login component when we first redirect to it, then after logging in is complete, we can redirect back to that pathname.

If you want to hold off on this until New React App is out, that's fine too.