From f67ee17012adcabe26da298fc41a2a97814b737f Mon Sep 17 00:00:00 2001 From: Youssef Date: Tue, 22 Feb 2022 13:55:47 +0100 Subject: [PATCH] fix: add redirect to component PropTypes --- .../src/component/user/Authentication/Authentication.tsx | 7 +------ frontend/src/component/user/HostedAuth/HostedAuth.jsx | 1 + frontend/src/component/user/Login/Login.tsx | 4 ++-- frontend/src/component/user/PasswordAuth/PasswordAuth.jsx | 1 + frontend/src/component/user/SimpleAuth/SimpleAuth.jsx | 1 + 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/frontend/src/component/user/Authentication/Authentication.tsx b/frontend/src/component/user/Authentication/Authentication.tsx index fcc27976c2..0e72bb345c 100644 --- a/frontend/src/component/user/Authentication/Authentication.tsx +++ b/frontend/src/component/user/Authentication/Authentication.tsx @@ -51,12 +51,7 @@ const Authentication = ({ redirect }: IAuthenticationProps) => { ); } else { - content = ( - - ); + content = ; } return ( <> diff --git a/frontend/src/component/user/HostedAuth/HostedAuth.jsx b/frontend/src/component/user/HostedAuth/HostedAuth.jsx index c738ca13ca..79cac78a8a 100644 --- a/frontend/src/component/user/HostedAuth/HostedAuth.jsx +++ b/frontend/src/component/user/HostedAuth/HostedAuth.jsx @@ -145,6 +145,7 @@ const HostedAuth = ({ authDetails, redirect }) => { HostedAuth.propTypes = { authDetails: PropTypes.object.isRequired, + redirect: PropTypes.string.isRequired, }; export default HostedAuth; diff --git a/frontend/src/component/user/Login/Login.tsx b/frontend/src/component/user/Login/Login.tsx index c346737ad9..8ce7ec763c 100644 --- a/frontend/src/component/user/Login/Login.tsx +++ b/frontend/src/component/user/Login/Login.tsx @@ -7,7 +7,7 @@ import { DEMO_TYPE } from '../../../constants/authTypes'; import Authentication from '../Authentication/Authentication'; import { useAuthDetails } from '../../../hooks/api/getters/useAuth/useAuthDetails'; import { useAuthUser } from '../../../hooks/api/getters/useAuth/useAuthUser'; -import { Redirect, useHistory } from 'react-router-dom'; +import { Redirect } from 'react-router-dom'; const Login = () => { const styles = useStyles(); @@ -18,7 +18,7 @@ const Login = () => { const redirect = query.get('redirect') || '/'; if (user) { - return ; + return ; } return ( diff --git a/frontend/src/component/user/PasswordAuth/PasswordAuth.jsx b/frontend/src/component/user/PasswordAuth/PasswordAuth.jsx index bf70f56dd0..e705614fe3 100644 --- a/frontend/src/component/user/PasswordAuth/PasswordAuth.jsx +++ b/frontend/src/component/user/PasswordAuth/PasswordAuth.jsx @@ -168,6 +168,7 @@ const PasswordAuth = ({ authDetails, redirect }) => { PasswordAuth.propTypes = { authDetails: PropTypes.object.isRequired, + redirect: PropTypes.string.isRequired, }; export default PasswordAuth; diff --git a/frontend/src/component/user/SimpleAuth/SimpleAuth.jsx b/frontend/src/component/user/SimpleAuth/SimpleAuth.jsx index c9dfb9e66b..5f5c4d57f2 100644 --- a/frontend/src/component/user/SimpleAuth/SimpleAuth.jsx +++ b/frontend/src/component/user/SimpleAuth/SimpleAuth.jsx @@ -79,6 +79,7 @@ const SimpleAuth = ({ authDetails, redirect }) => { SimpleAuth.propTypes = { authDetails: PropTypes.object.isRequired, + redirect: PropTypes.string.isRequired, }; export default SimpleAuth;