From 28d3319ba74865a1abd3c8e7b8740d7d27340e3e Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra Date: Thu, 17 Dec 2020 20:05:08 +0530 Subject: [PATCH] feat: add redirects after authentication --- client/src/components/Header/components/Login.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/components/Header/components/Login.js b/client/src/components/Header/components/Login.js index 690ac52df5..cbf2d08593 100644 --- a/client/src/components/Header/components/Login.js +++ b/client/src/components/Header/components/Login.js @@ -6,7 +6,7 @@ import { Button } from '@freecodecamp/react-bootstrap'; import { useTranslation } from 'react-i18next'; import { isSignedInSelector } from '../../../redux'; -import { apiLocation } from '../../../../config/env.json'; +import { apiLocation, homeLocation } from '../../../../config/env.json'; import { gtagReportConversion } from '../../../analytics/gtag'; @@ -27,7 +27,9 @@ function Login(props) { children, isSignedIn } = props; - const href = isSignedIn ? '/learn' : `${apiLocation}/signin`; + const href = isSignedIn + ? `${homeLocation}/learn` + : `${apiLocation}/signin?returnTo=${homeLocation}/learn`; return (