update
ccb65b2f
4 file(s) · +7 −3
| 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> |
| 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 |
| 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 | }, |
|
| 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", |