diff --git a/app/RefreshLoginComponent.tsx b/app/RefreshLoginComponent.tsx index 9bada77..3c361e6 100644 --- a/app/RefreshLoginComponent.tsx +++ b/app/RefreshLoginComponent.tsx @@ -4,7 +4,7 @@ import AbsoluteRedirect from "./login/AbsoluteRedirect"; import { OAuthContext } from "@guardian/pluto-headers"; import { useHistory } from "react-router"; -const RefreshLoginComponent: React.FC<{}> = () => { +const RefreshLoginComponent: React.FC = () => { const oAuthContext = useContext(OAuthContext); const history = useHistory(); @@ -29,12 +29,11 @@ const RefreshLoginComponent: React.FC<{}> = () => { return oAuthContext?.oAuthUri + "?" + encoded.join("&"); }; - return ( - - ); + if (oAuthContext) { + window.location.assign(makeLoginUrl()); + } + + return <>; }; export default RefreshLoginComponent; diff --git a/app/index.tsx b/app/index.tsx index b338039..c5d7f07 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -44,7 +44,7 @@ const useStyles = makeStyles((theme) => ({ })); const App: React.FC = () => { - const [startup, setStartup] = useState(true); + const [startup, setStartup] = useState(false); const [userProfile, setUserProfile] = useState( undefined