From 59c65446f9e864c3397140aad06114a76645fcf6 Mon Sep 17 00:00:00 2001 From: 0xcathiefish <72328723+0xcathiefish@users.noreply.github.com> Date: Mon, 6 Apr 2026 08:14:49 +0000 Subject: [PATCH] Remove hardcode of email restriction. --- backend/docker-compose.yml | 2 +- build.sh | 4 ---- frontend/auth-config.js | 1 - frontend/login.html | 8 -------- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/backend/docker-compose.yml b/backend/docker-compose.yml index 3cd64bc..e3524f6 100644 --- a/backend/docker-compose.yml +++ b/backend/docker-compose.yml @@ -1,6 +1,6 @@ services: backend: - image: ghcr.io/exchanges-lab/statistic/backend:v1.2 + image: ghcr.io/exchanges-lab/view/backend:latest container_name: backend networks: - cycle diff --git a/build.sh b/build.sh index 1fd1635..bce975e 100755 --- a/build.sh +++ b/build.sh @@ -5,12 +5,9 @@ # Set these in Cloudflare Pages > Settings > Environment Variables: # API_BASE_URL - Backend API URL (e.g. https://api.yourdomain.com) # GOOGLE_CLIENT_ID - Google OAuth Client ID -# ALLOWED_EMAILS - Comma-separated email whitelist (e.g. alice@gmail.com,bob@gmail.com) API_BASE_URL="${API_BASE_URL:-https://xxx.xxx.com}" GOOGLE_CLIENT_ID="${GOOGLE_CLIENT_ID:-xxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com}" -ALLOWED_EMAILS="${ALLOWED_EMAILS:-your-email@gmail.com}" - cat > frontend/auth-config.js << JSEOF window.API_CONFIG = { baseUrl: '${API_BASE_URL}' }; @@ -25,7 +22,6 @@ const AUTH_CONFIG = { }; window.AUTH_CONFIG = AUTH_CONFIG; -window.ALLOWED_EMAILS = '${ALLOWED_EMAILS}'.split(',').map(e => e.trim()); JSEOF echo "Generated auth-config.js with API_BASE_URL=${API_BASE_URL}" diff --git a/frontend/auth-config.js b/frontend/auth-config.js index 510178a..30eeb8d 100644 --- a/frontend/auth-config.js +++ b/frontend/auth-config.js @@ -11,4 +11,3 @@ const AUTH_CONFIG = { }; window.AUTH_CONFIG = AUTH_CONFIG; -window.ALLOWED_EMAILS = ['xiannvweideta@gmail.com']; diff --git a/frontend/login.html b/frontend/login.html index 51e9427..88e22a6 100644 --- a/frontend/login.html +++ b/frontend/login.html @@ -126,14 +126,6 @@ const credential = response.credential; const userData = parseJwt(credential); - // Email whitelist verification - const allowedEmails = window.ALLOWED_EMAILS || ['your-email@gmail.com']; - if (!allowedEmails.includes(userData.email)) { - document.getElementById('error-msg').textContent = 'Access denied: unauthorized email.'; - document.getElementById('error-msg').style.display = 'block'; - return; - } - const user = { email: userData.email, name: userData.name,