From 72f88a1ce58f91b65b8f91c505fdac30931c8eac Mon Sep 17 00:00:00 2001 From: Silen Naihin Date: Sat, 17 Feb 2024 14:01:12 -0500 Subject: [PATCH] shortening amount of files --- .env.development | 1 - .env.example | 2 ++ .env.production | 1 - CHANGELOG.md | 9 --------- app/components/stacks/v1/utils/signIn.tsx | 20 +++++++++++--------- public/stacks/v1/utils/signIn.tsx | 20 +++++++++++--------- 6 files changed, 24 insertions(+), 29 deletions(-) delete mode 100644 .env.development delete mode 100644 .env.production delete mode 100644 CHANGELOG.md diff --git a/.env.development b/.env.development deleted file mode 100644 index 81235826..00000000 --- a/.env.development +++ /dev/null @@ -1 +0,0 @@ -NEXT_PUBLIC_URL=http://localhost:3000 \ No newline at end of file diff --git a/.env.example b/.env.example index 3f16280e..035290e3 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,5 @@ +# Dependant on what stack you want to run + OPENAI_API_KEY=sk- HELICONE_API_KEY=sk- PINECONE_API_KEY= diff --git a/.env.production b/.env.production deleted file mode 100644 index 11160838..00000000 --- a/.env.production +++ /dev/null @@ -1 +0,0 @@ -NEXT_PUBLIC_URL=https://$NEXT_PUBLIC_VERCEL_URL diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index f06e0928..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# Change Log - -All notable changes to the "stackwise" extension will be documented in this file. - -Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. - -## [Unreleased] - -- Initial release diff --git a/app/components/stacks/v1/utils/signIn.tsx b/app/components/stacks/v1/utils/signIn.tsx index d7b0346f..1b5eb07d 100644 --- a/app/components/stacks/v1/utils/signIn.tsx +++ b/app/components/stacks/v1/utils/signIn.tsx @@ -1,24 +1,26 @@ -"use client"; - -import { supabaseClient } from "./stack-db"; +'use client'; +import { supabaseClient } from './stack-db'; export default function signIn() { - + const baseUrl = + process.env.NODE_ENV === 'production' + ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}` // Use Vercel's environment variable in production + : 'http://localhost:3000'; // Default to localhost in development + async function signInWithGithub() { - const { data, error } = await supabaseClient.auth.signInWithOAuth({ - provider: "github", + provider: 'github', options: { scopes: 'public_repo', - redirectTo: `${process.env.NEXT_PUBLIC_URL}/stacks/create-stack-boilerplate` + redirectTo: `${baseUrl}/stacks/create-stack-boilerplate`, }, }); } return ( - diff --git a/public/stacks/v1/utils/signIn.tsx b/public/stacks/v1/utils/signIn.tsx index d7b0346f..1b5eb07d 100644 --- a/public/stacks/v1/utils/signIn.tsx +++ b/public/stacks/v1/utils/signIn.tsx @@ -1,24 +1,26 @@ -"use client"; - -import { supabaseClient } from "./stack-db"; +'use client'; +import { supabaseClient } from './stack-db'; export default function signIn() { - + const baseUrl = + process.env.NODE_ENV === 'production' + ? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}` // Use Vercel's environment variable in production + : 'http://localhost:3000'; // Default to localhost in development + async function signInWithGithub() { - const { data, error } = await supabaseClient.auth.signInWithOAuth({ - provider: "github", + provider: 'github', options: { scopes: 'public_repo', - redirectTo: `${process.env.NEXT_PUBLIC_URL}/stacks/create-stack-boilerplate` + redirectTo: `${baseUrl}/stacks/create-stack-boilerplate`, }, }); } return ( -