Skip to content

Instantly share code, notes, and snippets.

View jackblanc's full-sized avatar

Jack Blanc jackblanc

View GitHub Profile
@mattkinnersley
mattkinnersley / auth.$path.tsx
Last active September 27, 2024 01:12
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",