Make destination account route not die
This commit is contained in:
parent
040a60a6d9
commit
826a849707
@ -2,10 +2,13 @@ import { Button, Card, Container, Heading, VStack } from "@chakra-ui/react";
|
|||||||
import { useLoaderData } from "@remix-run/react";
|
import { useLoaderData } from "@remix-run/react";
|
||||||
|
|
||||||
export async function loader({ context }: { context: RequestContext }) {
|
export async function loader({ context }: { context: RequestContext }) {
|
||||||
return context.env.ROBLOX_OAUTH_CLIENT_ID;
|
const { host, protocol } = new URL(context.request.url);
|
||||||
|
|
||||||
|
return { client_id: context.env.ROBLOX_OAUTH_CLIENT_ID, host, protocol };
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
|
const loaderData = useLoaderData<typeof loader>();
|
||||||
return (
|
return (
|
||||||
<Container pt="16vh">
|
<Container pt="16vh">
|
||||||
<Card borderRadius="32px" p="4vh">
|
<Card borderRadius="32px" p="4vh">
|
||||||
@ -16,10 +19,10 @@ export default function () {
|
|||||||
as="a"
|
as="a"
|
||||||
borderRadius="24px"
|
borderRadius="24px"
|
||||||
colorScheme="blue"
|
colorScheme="blue"
|
||||||
href={`https://apis.roblox.com/oauth/v1/authorize?client_id=${useLoaderData<
|
href={`https://apis.roblox.com/oauth/v1/authorize?client_id=${
|
||||||
typeof loader
|
loaderData.client_id
|
||||||
>()}&redirect_uri=${encodeURIComponent(
|
}&redirect_uri=${encodeURIComponent(
|
||||||
`${location.protocol}//${location.host}/api/data-transfers/verify`,
|
`${loaderData.protocol}//${loaderData.host}/api/data-transfers/verify`,
|
||||||
)}&response_type=code&scope=openid%20profile`}
|
)}&response_type=code&scope=openid%20profile`}
|
||||||
>
|
>
|
||||||
Verify
|
Verify
|
||||||
|
Loading…
x
Reference in New Issue
Block a user