Skip to content

Commit 684c083

Browse files
committed
chore(client): rm client-side redirect code for post-auth
1 parent 54ea1b6 commit 684c083

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

client/src/components/pages/ProtectedPageContainer.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {useOutletContext} from "react-router-dom";
44
import {LOGIN_PATH} from "../../constants/app";
55
import Intro from "../Intro";
66
import {Container, Spinner} from "reactstrap";
7-
import {setPostAuthPath} from "../../helpers/localStorage";
87

98
const LoadingContainer = React.memo(() => (
109
<Container>
@@ -21,8 +20,7 @@ const ProtectedPageContainer = React.memo(({children}) => {
2120
const onTerms = useCallback(() => setTermsModal(true), []);
2221
const onAccess = useCallback(() => {
2322
if (!userData) {
24-
// Set our post-auth redirect and redirect to sign in, so we can capture some information about their identity.
25-
setPostAuthPath(window.location.pathname);
23+
// Redirect to sign in, so we can capture some information about their identity.
2624
window.location.href = `${LOGIN_PATH}?redirect=${window.location.pathname}`;
2725
} else {
2826
// Signed in but terms not accepted yet; show the modal.

client/src/index.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
fetchMessages,
2424
fetchUser
2525
} from './actions.js'
26-
import {popPostAuthPath} from "./helpers/localStorage";
2726

2827

2928
const initialState = {};
@@ -51,13 +50,7 @@ render(
5150
document.querySelector('#root')
5251
);
5352

54-
store.dispatch(fetchUser()).then(() => {
55-
const postAuthPath = popPostAuthPath();
56-
if (postAuthPath) {
57-
window.location.replace(postAuthPath);
58-
}
59-
});
60-
53+
store.dispatch(fetchUser());
6154
store.dispatch(fetchMessages()); // Server-side messages, e.g. auth errors
6255

6356
store.dispatch(fetchAssays());

0 commit comments

Comments
 (0)