WIP 98c279f4
Steve · 2024-09-19 23:24 3 file(s) · +12 −3
astro.config.ts +0 −1
33 33
	vite: {
34 34
		define: {
35 35
			"process.env.NODE_ENV": `'${process.env.NODE_ENV}'`,
36 -
			"process.env": process.env,
37 36
		},
38 37
	},
39 38
	output: "hybrid",
src/components/SignInButton.tsx +4 −2
1 -
import { supabase } from "src/lib/supabase";
1 +
import { createClient } from "@supabase/supabase-js";
2 2
3 -
export function SignInButton() {
3 +
export function SignInButton({ supabaseUrl, supabaseAnonKey }) {
4 +
	const supabase = createClient(supabaseUrl, supabaseAnonKey);
5 +
4 6
	async function signInWithGithub() {
5 7
		await supabase.auth.signInWithOAuth({
6 8
			provider: "github",
src/pages/log.astro +8 −0
1 1
---
2 2
import PageLayout from "@/layouts/Base";
3 3
import { SignInButton } from "src/components/SignInButton";
4 +
const { env } = Astro.locals.runtime;
4 5
5 6
const meta = {
6 7
	title: "Log",
7 8
	description: "Public Log",
8 9
};
10 +
11 +
const supabaseUrl =
12 +
	env.PUBLIC_SUPABASE_URL || import.meta.env.PUBLIC_SUPABASE_URL;
13 +
const supabaseAnonKey =
14 +
	env.PUBLIC_SUPABASE_ANON_KEY || import.meta.env.PUBLIC_SUPABASE_ANON_KEY;
9 15
---
10 16
11 17
<PageLayout meta={meta}>
12 18
	<div class="space-y-6">
13 19
  	<SignInButton
20 +
   supabaseUrl={supabaseUrl}
21 +
   supabaseAnonKey={supabaseAnonKey}
14 22
      client:load />
15 23
	</div>
16 24
</PageLayout>