import type { RequestHandler } from '@sveltejs/kit';
import { buildSteamOpenIDLoginUrl } from '$lib/server/steam';

export const GET: RequestHandler = async ({ url }) => {
  const redirectTo = url.searchParams.get('redirect_uri');
  const loginUrl = buildSteamOpenIDLoginUrl(url.origin, redirectTo);
  return new Response(null, { status: 302, headers: { Location: loginUrl.toString() } });
};


