Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
car-crushers-portal/app/routes/data-transfer_.destination-account.tsx
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
34 lines (31 sloc)
1.11 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Button, Card, Container, Heading, VStack } from "@chakra-ui/react"; | |
import { useLoaderData } from "@remix-run/react"; | |
export async function loader({ context }: { context: RequestContext }) { | |
const { host, protocol } = new URL(context.request.url); | |
return { client_id: context.env.ROBLOX_OAUTH_CLIENT_ID, host, protocol }; | |
} | |
export default function () { | |
const loaderData = useLoaderData<typeof loader>(); | |
return ( | |
<Container pt="16vh"> | |
<Card borderRadius="32px" p="4vh"> | |
<VStack alignContent="center" gap="2vh"> | |
<Heading>Verify your new Roblox account</Heading> | |
<br /> | |
<Button | |
as="a" | |
borderRadius="24px" | |
colorScheme="blue" | |
href={`https://apis.roblox.com/oauth/v1/authorize?client_id=${ | |
loaderData.client_id | |
}&redirect_uri=${encodeURIComponent( | |
`${loaderData.protocol}//${loaderData.host}/api/data-transfers/verify`, | |
)}&response_type=code&scope=openid%20profile`} | |
> | |
Verify | |
</Button> | |
</VStack> | |
</Card> | |
</Container> | |
); | |
} |