Skip to content

Commit 7439998

Browse files
committed
update: hides login with GitHub from invite only sign in
1 parent 30c08c0 commit 7439998

File tree

5 files changed

+139
-45
lines changed

5 files changed

+139
-45
lines changed

.github/workflows/deploy.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy to GitHub Pages
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
workflow_dispatch:
77

88
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
@@ -19,50 +19,50 @@ concurrency:
1919
jobs:
2020
build:
2121
runs-on: ubuntu-latest
22-
22+
2323
steps:
2424
- name: Checkout
2525
uses: actions/checkout@v4
26-
26+
2727
- name: Setup Node.js
2828
uses: actions/setup-node@v4
2929
with:
30-
node-version: '20'
31-
cache: 'npm'
32-
30+
node-version: "20"
31+
cache: "npm"
32+
3333
- name: Install dependencies
3434
run: npm ci
35-
35+
3636
- name: Build with Vite
3737
env:
3838
# Public environment variables (safe to expose)
3939
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}
4040
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }}
4141
# Disable public registration for production
42-
ENABLE_PUBLIC_REGISTRATION: 'false'
42+
VITE_ENABLE_PUBLIC_REGISTRATION: "false"
4343
# Set to production to enable console stripping
4444
NODE_ENV: production
4545
run: npm run build
46-
46+
4747
- name: Copy index.html to 404.html for SPA routing
4848
run: cp ./dist/index.html ./dist/404.html
49-
49+
5050
- name: Prepare for GitHub Pages
5151
run: |
5252
# Add .nojekyll to prevent Jekyll processing
5353
touch ./dist/.nojekyll
54-
54+
5555
# Add CNAME file if using custom domain (comment out if not needed)
5656
# echo "yourdomain.com" > ./dist/CNAME
57-
57+
5858
# Verify the build output
5959
echo "=== Build Output Structure ==="
6060
ls -la ./dist/
61-
61+
6262
echo ""
6363
echo "=== JavaScript Files ==="
6464
find ./dist -name "*.js" -type f | head -10
65-
65+
6666
echo ""
6767
echo "=== Checking index.html ==="
6868
if [ -f "./dist/index.html" ]; then
@@ -73,23 +73,23 @@ jobs:
7373
echo "ERROR: index.html not found!"
7474
exit 1
7575
fi
76-
76+
7777
- name: Setup Pages
7878
uses: actions/configure-pages@v4
79-
79+
8080
- name: Upload artifact
8181
uses: actions/upload-pages-artifact@v3
8282
with:
83-
path: './dist'
84-
83+
path: "./dist"
84+
8585
deploy:
8686
environment:
8787
name: github-pages
8888
url: ${{ steps.deployment.outputs.page_url }}
8989
runs-on: ubuntu-latest
9090
needs: build
91-
91+
9292
steps:
9393
- name: Deploy to GitHub Pages
9494
id: deployment
95-
uses: actions/deploy-pages@v4
95+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ dist-ssr
2323
*.sln
2424
*.sw?
2525
/supabase
26-
*.sh
2726
/.claude

deploy-functions.sh

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/Users/bruzwj/Downloads/.env.local#!/bin/bash
2+
3+
# Deployment script for Supabase Edge Functions
4+
# Run this when Docker is working properly
5+
if [ -f .env.local ]; then
6+
# Load environment variables, handling = signs and quotes properly
7+
set -a
8+
source .env.local
9+
set +a
10+
fi
11+
12+
echo "🚀 Deploying Supabase Edge Functions..."
13+
14+
# Debug: Check if variables are loaded
15+
echo "Debug: SUPABASE_ACCESS_TOKEN is ${#SUPABASE_ACCESS_TOKEN} characters long"
16+
echo "Debug: SUPABASE_PROJECT_REF = $SUPABASE_PROJECT_REF"
17+
18+
# Ensure variables are set
19+
if [ -z "$SUPABASE_ACCESS_TOKEN" ]; then
20+
echo "Error: SUPABASE_ACCESS_TOKEN not found in .env.local"
21+
exit 1
22+
fi
23+
24+
if [ -z "$SUPABASE_PROJECT_REF" ]; then
25+
echo "Error: SUPABASE_PROJECT_REF not found in .env.local"
26+
exit 1
27+
fi
28+
29+
# Deploy analyze-stock (main entry point - critical fix for Alpaca credentials)
30+
echo "📦 Deploying alpaca-batch..."
31+
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy alpaca-batch --project-ref $SUPABASE_PROJECT_REF --no-verify-jwt
32+
33+
echo "📦 Deploying alpaca-proxy..."
34+
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy alpaca-proxy --project-ref $SUPABASE_PROJECT_REF --no-verify-jwt
35+
36+
echo "📦 Deploying settings-proxy..."
37+
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy settings-proxy --project-ref $SUPABASE_PROJECT_REF --no-verify-jwt
38+
39+
40+
echo "📦 Deploying execute-trade..."
41+
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy execute-trade --project-ref $SUPABASE_PROJECT_REF --no-verify-jwt
42+
43+
44+
# Deploy coordinator (needs --no-verify-jwt to access database properly)
45+
echo "📦 Deploying analysis-coordinator..."
46+
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy analysis-coordinator --project-ref $SUPABASE_PROJECT_REF --no-verify-jwt
47+
# Deploy coordinator (needs --no-verify-jwt to access database properly)
48+
echo "📦 Deploying rebalance-coordinator..."
49+
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy rebalance-coordinator --project-ref $SUPABASE_PROJECT_REF --no-verify-jwt
50+
51+
# Deploy invites
52+
echo "📦 Deploying send-invitation..."
53+
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy send-invitation --project-ref $SUPABASE_PROJECT_REF
54+
55+
56+
# Deploy process-scheduled-rebalances
57+
echo "📦 Deploying process-scheduled-rebalances..."
58+
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy process-scheduled-rebalances --project-ref $SUPABASE_PROJECT_REF
59+
60+
# Deploy process-scheduled-rebalances
61+
echo "📦 Deploying detect-stale-analysis..."
62+
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy detect-stale-analysis --project-ref $SUPABASE_PROJECT_REF
63+
64+
65+
66+
# Deploy all agent functions
67+
agents=(
68+
"agent-macro-analyst"
69+
"agent-market-analyst"
70+
"agent-news-analyst"
71+
"agent-social-media-analyst"
72+
"agent-fundamentals-analyst"
73+
"agent-bull-researcher"
74+
"agent-bear-researcher"
75+
"agent-research-manager"
76+
"agent-trader"
77+
"agent-risky-analyst"
78+
"agent-safe-analyst"
79+
"agent-neutral-analyst"
80+
"agent-risk-manager"
81+
"analysis-portfolio-manager"
82+
"rebalance-portfolio-manager"
83+
"opportunity-agent"
84+
)
85+
86+
for agent in "${agents[@]}"; do
87+
echo "📦 Deploying $agent..."
88+
SUPABASE_ACCESS_TOKEN=$SUPABASE_ACCESS_TOKEN npx supabase functions deploy $agent --project-ref $SUPABASE_PROJECT_REF
89+
done
90+
91+
echo "✅ All functions deployed successfully!"

src/pages/LoginPage.tsx

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function LoginPage() {
1616
const [error, setError] = useState("");
1717

1818
// Check if public registration is enabled
19-
const publicRegistrationEnabled = import.meta.env.ENABLE_PUBLIC_REGISTRATION !== 'false';
19+
const publicRegistrationEnabled = import.meta.env.VITE_ENABLE_PUBLIC_REGISTRATION !== 'false';
2020

2121
// Form state
2222
const [email, setEmail] = useState("");
@@ -119,29 +119,33 @@ export default function LoginPage() {
119119
</Alert>
120120
)}
121121

122-
<div className="relative">
123-
<div className="absolute inset-0 flex items-center">
124-
<span className="w-full border-t" />
125-
</div>
126-
<div className="relative flex justify-center text-xs uppercase">
127-
<span className="bg-background px-2 text-muted-foreground">
128-
Or continue with
129-
</span>
130-
</div>
131-
</div>
122+
{publicRegistrationEnabled && (
123+
<>
124+
<div className="relative">
125+
<div className="absolute inset-0 flex items-center">
126+
<span className="w-full border-t" />
127+
</div>
128+
<div className="relative flex justify-center text-xs uppercase">
129+
<span className="bg-background px-2 text-muted-foreground">
130+
Or continue with
131+
</span>
132+
</div>
133+
</div>
132134

133-
<Button
134-
type="button"
135-
variant="outline"
136-
className="w-full"
137-
onClick={handleGitHubLogin}
138-
disabled={isLoading}
139-
>
140-
<svg className="mr-2 h-4 w-4" viewBox="0 0 24 24" fill="currentColor">
141-
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
142-
</svg>
143-
GitHub
144-
</Button>
135+
<Button
136+
type="button"
137+
variant="outline"
138+
className="w-full"
139+
onClick={handleGitHubLogin}
140+
disabled={isLoading}
141+
>
142+
<svg className="mr-2 h-4 w-4" viewBox="0 0 24 24" fill="currentColor">
143+
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
144+
</svg>
145+
GitHub
146+
</Button>
147+
</>
148+
)}
145149
</CardContent>
146150

147151
<CardFooter className="flex flex-col space-y-4">

src/pages/RegisterPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function RegisterPage() {
1717
const [successMessage, setSuccessMessage] = useState("");
1818

1919
// Check if public registration is enabled
20-
const publicRegistrationEnabled = import.meta.env.ENABLE_PUBLIC_REGISTRATION !== 'false';
20+
const publicRegistrationEnabled = import.meta.env.VITE_ENABLE_PUBLIC_REGISTRATION !== 'false';
2121

2222
// Form state
2323
const [name, setName] = useState("");

0 commit comments

Comments
 (0)