Files
view/frontend/auth-config.js
T
0xcathiefish 619391f87a Add build.sh for Cloudflare Pages env-based config injection
- Add build.sh that generates auth-config.js from environment variables
  (API_BASE_URL, GOOGLE_CLIENT_ID, ALLOWED_EMAILS) at build time
- Move email whitelist from hardcoded login.html to window.ALLOWED_EMAILS
  in auth-config.js, so it can be configured via env vars
- Reset auth-config.js to placeholder defaults in repo
- Update README.md and README_CN.md deployment docs for both options

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 15:47:52 +00:00

15 lines
422 B
JavaScript

window.API_CONFIG = { baseUrl: 'https://xxx.xxx.com' };
const AUTH_CONFIG = {
clientId: 'xxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com',
onSuccess: (user) => {
console.log('Authentication successful:', user.email);
},
onError: (error) => {
console.error('Authentication error:', error);
}
};
window.AUTH_CONFIG = AUTH_CONFIG;
window.ALLOWED_EMAILS = ['your-email@gmail.com'];