Skip to content

Commit 0e8371c

Browse files
committed
Update redirect log and remove storage item in checkot page
1 parent 2257f59 commit 0e8371c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/common/context/PrivateRouteWrapper.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ export const withGuard = (PassedComponent) => {
6262
);
6363
}
6464
if (requiresDefaultRedirect) {
65-
log('redirect choose-program setted');
65+
log(`redirect ${defaultRedirect} setted`);
6666
localStorage.setItem('redirect', defaultRedirect);
6767
redirectToLogin();
6868
} else {
69-
log('redirect setted');
69+
log(`redirect to ${pathname} setted`);
7070
localStorage.setItem('redirect', pathname);
7171
redirectToLogin();
7272
}

src/pages/checkout.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import useAuth from '../common/hooks/useAuth';
1515
import useSession from '../common/hooks/useSession';
1616
import ContactInformation from '../js_modules/checkout/ContactInformation';
1717
import ChooseYourClass from '../js_modules/checkout/ChooseYourClass';
18-
import { isWindow, getTimeProps, removeURLParameter, getQueryString, getStorageItem } from '../utils';
18+
import { isWindow, getTimeProps, removeURLParameter, getQueryString, getStorageItem, removeStorageItem } from '../utils';
1919
import Summary from '../js_modules/checkout/Summary';
2020
import PaymentInfo from '../js_modules/checkout/PaymentInfo';
2121
import useSignup from '../common/store/actions/signupAction';
@@ -119,6 +119,7 @@ function Checkout() {
119119
const queryServiceExists = queryMentorshipServiceSlugExists || queryEventTypeSetSlugExists;
120120

121121
useEffect(() => {
122+
removeStorageItem('redirect');
122123
const translations = getTranslations(t);
123124
const defaultPlan = (plan && encodeURIComponent(plan)) || encodeURIComponent(BASE_PLAN);
124125
bc.payment().getPlan(defaultPlan).then(async (resp) => {

0 commit comments

Comments
 (0)