Oops we forgot the scope
This commit is contained in:
@@ -2,27 +2,17 @@ import { Button, Card, Container, Heading, VStack } from "@chakra-ui/react";
|
||||
import { useLoaderData } from "@remix-run/react";
|
||||
|
||||
export async function loader({ context }: { context: RequestContext }) {
|
||||
const state = crypto.randomUUID().replace(/-/g, "");
|
||||
const url = new URL(context.request.url);
|
||||
url.pathname = "/api/data-requests/session";
|
||||
|
||||
await context.env.DATA.put(
|
||||
`rbxstate_${state}`,
|
||||
context.request.headers.get("cf-connecting-ip") ?? "",
|
||||
{
|
||||
expirationTtl: 300,
|
||||
},
|
||||
);
|
||||
|
||||
return {
|
||||
client_id: context.env.ROBLOX_OAUTH_CLIENT_ID,
|
||||
state,
|
||||
url: encodeURIComponent(url.href),
|
||||
};
|
||||
}
|
||||
|
||||
export default function () {
|
||||
const { client_id, state, url } = useLoaderData<typeof loader>();
|
||||
const { client_id, url } = useLoaderData<typeof loader>();
|
||||
|
||||
return (
|
||||
<Container pt="16vh">
|
||||
@@ -34,7 +24,7 @@ export default function () {
|
||||
as="a"
|
||||
borderRadius="24px"
|
||||
colorScheme="blue"
|
||||
href={`https://apis.roblox.com/oauth/v1/authorize?client_id=${client_id}&redirect_uri=${url}&response_type=code&state=${state}`}
|
||||
href={`https://apis.roblox.com/oauth/v1/authorize?client_id=${client_id}&redirect_uri=${url}&response_type=code&scope=openid%20profile`}
|
||||
>
|
||||
Log in with Roblox
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user