Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions _chapters/redirect-on-login.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ Let's start by adding a method to read the `redirect` URL from the querystring.

``` coffee
function querystring(name, url = window.location.href) {
name = name.replace(/[[]]/g, "\\$&");

const regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)", "i");
const regex = new RegExp("[?&]" + name + "(=([^&#]*))", "i");
const results = regex.exec(url);

if (!results) {
Expand All @@ -27,7 +25,7 @@ function querystring(name, url = window.location.href) {
return "";
}

return decodeURIComponent(results[2].replace(/\+/g, " "));
return decodeURI(results[2].replace(/\+/g, " "));
}
```

Expand All @@ -54,7 +52,7 @@ export default ({ component: C, props: cProps, ...rest }) => {
};
```

<img class="code-marker" src="/assets/s.png" />And remove the following from the `handleSubmit` method in `src/containers/Login.js`.
<img class="code-marker" src="/assets/s.png" />And remove the following from the `handleSubmit` method in `src/containers/Login.js` and from the `handleConfirmationSubmit` method in `src/containers/Signup.js`.

``` coffee
this.props.history.push("/");
Expand Down