Skip to content

Instantly share code, notes, and snippets.

View mattkinnersley's full-sized avatar
⌨️
typing

Matt Kinnersley mattkinnersley

⌨️
typing
View GitHub Profile
@mattkinnersley
mattkinnersley / auth.$path.tsx
Last active August 23, 2024 06:44
SST Ion Auth + Remix
export async function loader({ request, params }: LoaderFunctionArgs) {
if (params.path === "callback") {
const { searchParams } = new URL(request.url);
const code = searchParams.get("code");
if (code) {
const response = await fetch(import.meta.env.VITE_AUTH_URL + "/token", {
method: "POST",
body: new URLSearchParams({
grant_type: "authorization_code",