Skip to content

Commit

Permalink
shortening amount of files
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenNaihin committed Feb 17, 2024
1 parent 7f5dc43 commit 72f88a1
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 29 deletions.
1 change: 0 additions & 1 deletion .env.development

This file was deleted.

2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Dependant on what stack you want to run

OPENAI_API_KEY=sk-
HELICONE_API_KEY=sk-
PINECONE_API_KEY=
Expand Down
1 change: 0 additions & 1 deletion .env.production

This file was deleted.

9 changes: 0 additions & 9 deletions CHANGELOG.md

This file was deleted.

20 changes: 11 additions & 9 deletions app/components/stacks/v1/utils/signIn.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<button
<button
onClick={signInWithGithub}
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
className="rounded bg-blue-500 px-4 py-2 font-bold text-white hover:bg-blue-700"
>
Sign in with Github
</button>
Expand Down
20 changes: 11 additions & 9 deletions public/stacks/v1/utils/signIn.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<button
<button
onClick={signInWithGithub}
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
className="rounded bg-blue-500 px-4 py-2 font-bold text-white hover:bg-blue-700"
>
Sign in with Github
</button>
Expand Down

0 comments on commit 72f88a1

Please sign in to comment.