Files
outline/app/scenes/DesktopRedirect.tsx
T
Tom Moor e571208871 fix: Spelling, grammar, punctuation, and translation string errors (#14017)
* fix: Spelling, grammar, punctuation, and translation string errors

* fix: Remove duplicate period and comma splice from review feedback
2026-10-11 09:07:07 -04:00

41 lines
1.1 KiB
TypeScript

import { useEffect } from "react";
import styled from "styled-components";
import Flex from "~/components/Flex";
import useQuery from "~/hooks/useQuery";
import Desktop from "~/utils/Desktop";
import { SigningIn } from "./Login/components/SigningIn";
const DesktopRedirect = () => {
const params = useQuery();
const token = params.get("token");
useEffect(() => {
if (token) {
window.open(
`${Desktop.protocol}://${window.location.host}/auth/redirect?token=${token}`,
"_self"
);
// Clean the url after a short delay so it's not possible to hit reload, reusing the transfer token
// will not work and changing the location immediately cancels the window.open call in Safari.
setTimeout(() => (window.location.search = ""), 500);
}
}, [token]);
return (
<Centered align="center" justify="center" column auto>
<SigningIn />
</Centered>
);
};
const Centered = styled(Flex)`
user-select: none;
width: 90vw;
height: 100%;
max-width: 320px;
margin: 0 auto;
`;
export default DesktopRedirect;