feat: add redirects after authentication
This commit is contained in:
@ -6,7 +6,7 @@ import { Button } from '@freecodecamp/react-bootstrap';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { isSignedInSelector } from '../../../redux';
|
import { isSignedInSelector } from '../../../redux';
|
||||||
import { apiLocation } from '../../../../config/env.json';
|
import { apiLocation, homeLocation } from '../../../../config/env.json';
|
||||||
|
|
||||||
import { gtagReportConversion } from '../../../analytics/gtag';
|
import { gtagReportConversion } from '../../../analytics/gtag';
|
||||||
|
|
||||||
@ -27,7 +27,9 @@ function Login(props) {
|
|||||||
children,
|
children,
|
||||||
isSignedIn
|
isSignedIn
|
||||||
} = props;
|
} = props;
|
||||||
const href = isSignedIn ? '/learn' : `${apiLocation}/signin`;
|
const href = isSignedIn
|
||||||
|
? `${homeLocation}/learn`
|
||||||
|
: `${apiLocation}/signin?returnTo=${homeLocation}/learn`;
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
bsStyle='default'
|
bsStyle='default'
|
||||||
|
Reference in New Issue
Block a user