Commit Graph

6 Commits

Author SHA1 Message Date
Abner
d1d440621e feat(security): 添加访问控制和身份验证机制 2025-08-11 00:31:51 +08:00
Abner
ecc0e66755 feat(giffgaff): 实现短信验证码一键激活功能
- 新增 giffgaff-sms-activate.js 函数,实现短信验证码激活流程
- 在前端集成短信激活功能,支持一键激活并获取 LPA
- 优化登录界面,增加 Cookie 登录方式
- 实现 Cookie 有效性定时检测,提高用户体验
2025-08-10 23:45:19 +08:00
Abner
ee034d3cb9 feat(giffgaff): 支持 PKCE 公有客户端和机密客户端的 OAuth 令牌交换
- 新增 giffgaff-token-exchange.js 函数处理 OAuth 令牌交换
- 增加对 PKCE 公有客户端和机密客户端的支持
- 优化令牌交换流程,支持可选的 Basic 认证
- 更新前端和后端的 OAuth 配置
2025-08-10 19:23:20 +08:00
Abner
f5a6ca01c1 fix: 修复Simyo登录API端点配置问题
- 修复API端点检测逻辑,正确识别cosr.eu.org域名
- 为server.js添加完整的Simyo API代理路由
- 修复createHeaders函数,确保本地环境也发送必要的API头部
- 统一本地和生产环境的API路径映射
- 解决404错误和JSON解析错误问题
2025-08-01 21:54:56 +08:00
Abner
2c3e30a078 refactor: 项目清理和文档现代化
- 更新README.md技术架构描述,强调Node.js + Netlify Functions架构
- 完全重写Cookie登录设置指南,移除PHP依赖说明
- 新增遗留PHP文件说明文档,明确文件状态和处理方式
- 更新前后端架构分析文档,反映当前Node.js架构
- 完善server.js,添加缺失的GraphQL代理函数引用
- 新增项目清理总结文档,详细记录架构升级过程
- 优化项目结构和文档组织,提高可维护性
- 确保所有文档与当前Node.js架构保持一致
2025-08-01 21:42:06 +08:00
Abner
ab8f0c05d8 🚀 Major upgrade: Convert to Node.js architecture with Netlify Functions
🔄 Complete Architecture Transformation:
- Migrated from PHP to Node.js backend
- Implemented Netlify Functions for serverless deployment
- Added Express.js server for local development
- Full compatibility with modern deployment platforms

🛠️ New Netlify Functions:
- giffgaff-mfa-challenge.js: Handles MFA email verification with proper headers
- giffgaff-mfa-validation.js: Processes MFA code validation
- verify-cookie.js: Cookie authentication converted from PHP to Node.js

 MFA 403 Error Resolution:
- Proper Origin and Referer headers in server-side requests
- Comprehensive error logging for debugging
- Timeout handling and robust error responses
- Should completely resolve MFA authentication issues

🍪 Enhanced Cookie Login:
- Full Node.js implementation replacing PHP dependency
- Works on all deployment platforms (Netlify, Vercel, traditional servers)
- Intelligent cookie parsing and validation
- Secure API calls with proper headers

�� Development Experience:
- package.json with all necessary dependencies
- Local development server (server.js)
- Environment configuration (env.example)
- Hot reload support with nodemon

🌐 Deployment Improvements:
- Netlify Functions integration
- Updated netlify.toml configuration
- Automatic dependency installation
- Zero-config deployment process

🎯 Key Benefits:
-  Resolves MFA 403 errors through proper server-side handling
-  Cookie login works on all platforms (no PHP dependency)
-  Better error handling and logging
-  Modern serverless architecture
-  Improved development experience
-  Full compatibility with static hosting platforms

📋 Technical Stack:
- Frontend: Pure HTML/CSS/JavaScript (unchanged)
- Backend: Node.js + Express.js (local) / Netlify Functions (production)
- Dependencies: axios, cors, helmet, morgan, dotenv
- Deployment: Netlify with automatic function deployment

This major upgrade modernizes the entire backend architecture while maintaining full frontend compatibility. The MFA 403 error should now be completely resolved through proper server-side request handling.
2025-08-01 21:03:25 +08:00