Skip to content

Commit

Permalink
Merge pull request #12 from guardian/da_refresh
Browse files Browse the repository at this point in the history
Attempt to Refresh Log In
  • Loading branch information
Dala0 committed Jul 18, 2022
2 parents a814275 + 5a8bcf0 commit a148aac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions app/RefreshLoginComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -29,12 +29,11 @@ const RefreshLoginComponent: React.FC<{}> = () => {
return oAuthContext?.oAuthUri + "?" + encoded.join("&");
};

return (
<AbsoluteRedirect
to={makeLoginUrl()}
descriptiveLabel="Redirecting to login service..."
/>
);
if (oAuthContext) {
window.location.assign(makeLoginUrl());
}

return <></>;
};

export default RefreshLoginComponent;
2 changes: 1 addition & 1 deletion app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<JwtDataShape | undefined>(
undefined
Expand Down

0 comments on commit a148aac

Please sign in to comment.