update ccb65b2f
Steve · 2024-09-20 12:44 4 file(s) · +7 −3
callback (deleted) +0 −1
1 -
<!doctype html><title>Redirecting to: https://stevedylan.dev/auth/auth-code-error</title><meta http-equiv="refresh" content="2;url=https://stevedylan.dev/auth/auth-code-error"><meta name="robots" content="noindex"><link rel="canonical" href="https://stevedylan.dev/auth/auth-code-error"><body>	<a href="https://stevedylan.dev/auth/auth-code-error">Redirecting from <code>/auth/callback</code> to <code>https://stevedylan.dev/auth/auth-code-error</code></a></body>
src/components/SignInButton.tsx +3 −0
4 4
	async function signInWithGithub() {
5 5
		await supabase.auth.signInWithOAuth({
6 6
			provider: "github",
7 +
			options: {
8 +
				redirectTo: "http://localhost:4321/auth/callback",
9 +
			},
7 10
		});
8 11
	}
9 12
src/pages/auth/callback.ts +3 −2
1 1
import { createServerClient, parseCookieHeader } from "@supabase/ssr";
2 2
import { type APIRoute } from "astro";
3 +
export const prerender = false;
3 4
4 5
export const GET: APIRoute = async ({ request, cookies, redirect }) => {
5 6
	const requestUrl = new URL(request.url);
13 14
			{
14 15
				cookies: {
15 16
					getAll() {
16 -
						return parseCookieHeader(Astro.request.headers.get("Cookie") ?? "");
17 +
						return parseCookieHeader(request.headers.get("Cookie") ?? "");
17 18
					},
18 19
					setAll(cookiesToSet) {
19 20
						cookiesToSet.forEach(({ name, value, options }) =>
20 -
							Astro.cookies.set(name, value, options),
21 +
							cookies.set(name, value, options),
21 22
						);
22 23
					},
23 24
				},
src/pages/log.astro +1 −0
1 1
---
2 2
import PageLayout from "@/layouts/Base";
3 3
import { SignInButton } from "src/components/SignInButton";
4 +
export const prerender = false;
4 5
5 6
const meta = {
6 7
	title: "Log",