Commit graph

42 commits

Author SHA1 Message Date
root
1c16b16889 fix: Robust login detection with multiple confirmation checks
All checks were successful
build-and-push / lint (push) Successful in 7s
build-and-push / sonar (push) Successful in 20s
build-and-push / docker (push) Successful in 11s
- isLoggedIn(): Wait for egs-navigation element, add timeout
- attemptBrowserLogin(): Multiple login status checks after navigation
- Manual login wait loop: Confirm stable login state before proceeding
- Add delays to let page stabilize before checking login status
- Better logging for debugging login flow

Fixes issue where login succeeded but was reported as failed due to timing
2026-03-08 14:56:51 +00:00
root
5d41b323e5 feat: Final hybrid login implementation (FlareSolverr + Cookie persistence)
All checks were successful
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Successful in 20s
build-and-push / docker (push) Successful in 11s
- epic-claimer-new.js: Complete rewrite with practical approach
  - FlareSolverr integration for Cloudflare solving
  - Cookie persistence (saved to epic-cookies.json)
  - Auto-load cookies on startup (no login needed if valid)
  - Manual login fallback via noVNC if needed
  - Proper 2FA/OTP support
  - Better error handling and logging

- SETUP.md: Complete setup guide
  - Docker Compose examples
  - Environment variable reference
  - Troubleshooting section
  - 2FA setup instructions
  - Volume backup/restore

- README.md: Add reference to SETUP.md

- OAUTH_DEVICE_FLOW_ISSUE.md: Document why OAuth Device Flow doesn't work
  - Epic Games doesn't provide public device auth credentials
  - Client credentials flow requires registered app
  - Hybrid approach is the practical solution

How it works:
1. First run: Login via browser (FlareSolverr helps with Cloudflare)
2. Cookies saved to epic-cookies.json
3. Subsequent runs: Load cookies, no login needed
4. If cookies expire: Auto-fallback to login flow
5. Manual login via noVNC if automation fails

This is the approach used by all successful Epic Games claimer projects.
2026-03-08 14:52:13 +00:00
root
c8ccde9c22 fix: Fallback to browser login when OAuth Device Flow fails
All checks were successful
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Successful in 20s
build-and-push / docker (push) Successful in 11s
- epic-claimer-new.js: Try Device Flow first, fall back to email/password
- Fixes: invalid_client_credentials error when device auth not configured
- Users with EG_EMAIL/EG_PASSWORD can now use browser login as fallback
- Device Flow remains available for users with valid credentials

Behavior:
1. Try OAuth Device Flow (bypasses Cloudflare)
2. On failure (invalid credentials), use browser login
3. Browser login uses EG_EMAIL/EG_PASSWORD/EG_OTPKEY
4. Manual login via noVNC if both methods fail
2026-03-08 14:36:50 +00:00
root
393f70d409 feat: Add OAuth Device Flow login to bypass Cloudflare
All checks were successful
build-and-push / lint (push) Successful in 9s
build-and-push / sonar (push) Successful in 21s
build-and-push / docker (push) Successful in 13s
- src/device-login.js: New module implementing Epic Games OAuth Device Flow
- src/logger.js: Simple logger module for consistent logging
- src/config.js: Add deviceAuthClientId and deviceAuthSecret config
- epic-claimer-new.js: Use OAuth Device Flow instead of browser login
- Cloudflare bypass: Device Flow uses API, user logs in own browser
- Based on: https://github.com/claabs/epicgames-freegames-node

How it works:
1. Get client credentials from Epic OAuth API
2. Get device authorization code with verification URL
3. Send user notification with login link
4. User clicks link and logs in (handles Cloudflare manually)
5. Poll for authorization completion
6. Save and use access/refresh tokens
7. Tokens auto-refresh on expiry

Benefits:
- No Cloudflare issues (no bot detection)
- Persistent tokens (no repeated logins)
- Works in headless mode
- More reliable than browser automation
2026-03-08 14:26:44 +00:00
root
f1d647bcb2 fix: Robust Cloudflare detection to prevent Playwright frame crashes
All checks were successful
build-and-push / lint (push) Successful in 7s
build-and-push / sonar (push) Successful in 19s
build-and-push / docker (push) Successful in 11s
- src/cloudflare.js: Add try-catch around each locator operation in isCloudflareChallenge
- src/cloudflare.js: Add waitForLoadState before checking for Cloudflare
- src/cloudflare.js: Remove redundant outer try-catch (unreachable code)
- epic-claimer-new.js: Add delay after page.goto before checking Cloudflare
- epic-claimer-new.js: Wrap isChallenge() call in try-catch

Fixes: TypeError: Cannot read properties of undefined (reading 'childFrames')
2026-03-08 14:14:55 +00:00
root
48c861b3de fix: Multiple bug fixes and code cleanup
All checks were successful
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Successful in 21s
build-and-push / docker (push) Successful in 25s
- package.json: Add missing @eslint/js and globals devDependencies
- docker-entrypoint.sh: Fix X11 lock file name (.X1-lock → .X11-lock)
- epic-claimer-new.js: Use imported solveCloudflare/isCloudflareChallenge instead of duplicate implementations
- src/cloudflare.js: Fix solveCloudflare to use cfg.flaresolverr_url, remove unused imports
- epic-games.js: Remove unused code (getFreeGamesFromGraphQL, exchangeTokenForCookies, FREE_GAMES_QUERY, deviceAuthLoginSuccess variable)
- Run eslint --fix to clean up trailing spaces
2026-03-08 13:58:57 +00:00
nocci
e0c97f8d7c feat[cloudflare]: integrate FlareSolverr for automated Cloudflare challenge resolution
- Add Cloudflare bypass functionality using FlareSolverr service
- Configure FlareSolverr Docker service with environment options
- Add flaresolverr_url config option with default localhost fallback
- Replace manual Cloudflare challenge notification with automated solving attempt
- Create new cloudflare.js module with health check, challenge detection, and solution application
2026-03-08 13:06:46 +00:00
nocci
1ddcf1d8af refactor(epic): switch from external API calls to in-page browser-based fetching
All checks were successful
build-and-push / lint (push) Successful in 10s
build-and-push / sonar (push) Successful in 20s
build-and-push / docker (push) Successful in 11s
-removed axios dependency and replaced server-side API calls with in-page fetch() execution
-migrated from OAuth device flow to browser-based authentication using persistent context
-simplified claim flow by removing manual token exchange and cookie management
2026-03-08 12:54:25 +00:00
nocci
bceb642bcb refactor(auth): remove quotes from object keys and trailing commas in device auth flow
All checks were successful
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Successful in 20s
build-and-push / docker (push) Successful in 11s
2026-03-08 12:35:54 +00:00
nocci
52bd469976 refactor(auth): replace client credentials with Basic auth and normalize response fields
Some checks failed
build-and-push / lint (push) Failing after 7s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
2026-03-08 12:32:49 +00:00
nocci
d4acc813bc refactor(api): restructure Epic Games OAuth flow with new client credentials step
Some checks failed
build-and-push / lint (push) Failing after 8s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
The OAuth device flow has been refactored to use the client credentials grant flow as the first step, followed by a proper device authorization request using the obtained client credentials token. This change modernizes the authentication flow to align with current Epic Games OAuth requirements and replaces the previous direct device authorization approach that used client_id and client_secret in the request body with the standardized authorization header pattern.
2026-03-08 12:23:52 +00:00
nocci
e8c28db63d feat(auth): add client_secret to Epic Games OAuth requests
All checks were successful
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Successful in 20s
build-and-push / docker (push) Successful in 11s
2026-03-08 11:57:30 +00:00
nocci
1455963346 fix(api): update Epic Games OAuth endpoints and client ID
All checks were successful
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Successful in 20s
build-and-push / docker (push) Successful in 11s
The changes replace old API endpoints with current Epic Games' Public Account Service URLs and update the client ID across all OAuth requests (device authorization, token exchange, and refresh). This resolves authentication failures caused by deprecated endpoints and credentials.
2026-03-08 11:52:54 +00:00
nocci
e494c1c04e fix(api): switch to URLSearchParams for OAuth device authorization body
All checks were successful
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Successful in 20s
build-and-push / docker (push) Successful in 11s
2026-03-08 11:38:54 +00:00
nocci
84e50f07f2 fix(api): update Epic Games OAuth endpoint and add missing Content-Type header
All checks were successful
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Successful in 20s
build-and-push / docker (push) Successful in 11s
Replace legacy OAuth token endpoint with new Epic Games API endpoint,
and add required Content-Type header for device authorization request
to comply with updated API expectations.
2026-03-08 11:35:07 +00:00
nocci
1cf4c86646 fix(api): update Epic Games OAuth endpoints and response field names
All checks were successful
build-and-push / lint (push) Successful in 7s
build-and-push / sonar (push) Successful in 20s
build-and-push / docker (push) Successful in 11s
Update OAuth endpoints to new public service URLs and adapt to camelCase
response fields in device authorization response.
2026-03-08 11:30:08 +00:00
nocci
0a5f40341b refactor(auth): add device auth reuse for legacy account migration
All checks were successful
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Successful in 21s
build-and-push / docker (push) Successful in 11s
- imports device auth utility functions
- adds logic to reuse Epic Games device authentication from legacy mode
- loads device auth cookies (EPIC_SSO_RM, EPIC_DEVICE, EPIC_SESSION_AP) when available
- falls back to regular authentication if device auth is not present

This enables seamless transition for users migrating from legacy authentication while maintaining backward compatibility.
2026-03-08 11:18:28 +00:00
nocci
7df5c2e2fe 💄 style(epic-claimer): remove unnecessary code
Some checks failed
build-and-push / lint (push) Failing after 7s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
- delete unused screenshot function for cleaner code structure
2026-01-08 15:49:56 +00:00
nocci
c466458d41 💄 style(epic-claimer): remove unnecessary newline
Some checks failed
build-and-push / lint (push) Failing after 8s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
- delete extra newline for cleaner code structure
2026-01-08 15:49:15 +00:00
nocci
866f06e505 feat(helper): add screenshot helper function
Some checks failed
build-and-push / lint (push) Failing after 7s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
- introduce a new screenshot helper function for path resolution
- enhance code readability by organizing screenshot path management
2026-01-08 15:47:59 +00:00
nocci
af90aa7c42 ♻️ refactor(epic-claimer): enhance screenshot path resolution
Some checks failed
build-and-push / lint (push) Successful in 7s
build-and-push / sonar (push) Failing after 0s
build-and-push / docker (push) Has been skipped
- improve screenshot path by using path.resolve for better cross-platform compatibility
- organize screenshots into a structured directory hierarchy
2026-01-08 15:27:19 +00:00
nocci
fd0fc4e981 ♻️ refactor(code): remove unused code and clean up
Some checks failed
build-and-push / lint (push) Failing after 8s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
- remove unused screenshot helper function
- remove unnecessary empty arguments from launch options
- add spacing for readability in async functions
2026-01-08 15:20:21 +00:00
nocci
58282897b5 feat(epic-claimer): implement OAuth and game claiming enhancements
Some checks failed
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Failing after 0s
build-and-push / docker (push) Has been skipped
- add OAuth device flow for secure authentication
- implement automatic and manual login handling
- enhance game claiming process with error handling and notifications

♻️ refactor(epic-claimer): remove unused code and improve structure

- remove unused resolve function
- restructure authentication and login logic for clarity

📝 docs(epic-claimer): update comments for better code understanding

- clarify function purposes and steps in comments
- add detailed explanations for new authentication flow
2026-01-08 15:14:58 +00:00
nocci
a5e5d8e5e8 ♻️ refactor(epic-claimer): simplify epic claimer logic
Some checks failed
build-and-push / lint (push) Failing after 7s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
- remove unused functions and comments for clarity
- streamline login logic and error handling
- prepare for future enhancements with modular function placeholders
2026-01-08 15:02:11 +00:00
nocci
2dc018f2d6 test(epic-claimer-new): add comprehensive tests for epic games claimer
Some checks failed
build-and-push / lint (push) Failing after 7s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
- implement extensive testing for new epic games claiming functionality
- ensure robust coverage of API interactions, OAuth flows, and game claiming logic

 feat(epic-claimer-new): introduce new epic games claiming logic

- add new logic for claiming free games via API with OAuth device flow
- implement automatic cookie reuse and manual login fallback
- enhance error handling and logging for improved debugging

♻️ refactor(epic-claimer-new): optimize code structure and modularity

- refactor functions for better code organization and readability
- modularize authentication and game claiming processes for reusability

🔧 chore(eslintrc): update eslint configuration

- add stylistic plugins and rules for better code consistency
- configure globals and parser options for modern JavaScript compatibility
2026-01-08 14:59:01 +00:00
nocci
dc54be10e8 feat(epic-claimer): add new imports and constants
Some checks failed
build-and-push / lint (push) Failing after 10s
build-and-push / docker (push) Has been skipped
build-and-push / sonar (push) Has been skipped
- import axios, playwright-firefox, otplib, and node modules for enhanced functionality
- add utility imports from local modules for better code organization
- define URL_CLAIM, COOKIES_PATH, and BEARER_TOKEN_NAME constants for clearer code structure
2026-01-08 13:23:01 +00:00
nocci
c067ad71fe update 2026-01-08 12:56:49 +00:00
nocci
2140139fc9 ♻️ refactor(auth): streamline login process
Some checks failed
build-and-push / lint (push) Failing after 1s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
- simplify login logic by removing unused code
- improve error handling and logging during login
- add retry mechanism for login attempts

🔧 chore(gitignore): update ignore file

- add .continue to .gitignore to prevent accidental commits of temporary files
2026-01-08 12:42:33 +00:00
nocci
37de92c92e fix: handle epic login captcha manually in legacy/new flows
Some checks failed
build-and-push / lint (push) Failing after 1s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
2025-12-31 13:50:14 +00:00
nocci
728d08e551 fix: retry continue/submit on epic password and otp steps 2025-12-31 13:33:49 +00:00
nocci
ec69bf1a0c fix: click continue button on epic email step in new claimer
All checks were successful
build-and-push / lint (push) Successful in 4s
build-and-push / sonar (push) Successful in 12s
build-and-push / docker (push) Successful in 2m51s
2025-12-31 13:32:39 +00:00
nocci
2592de2285 fix: handle epic MFA code inputs with multiple fields
All checks were successful
build-and-push / lint (push) Successful in 4s
build-and-push / sonar (push) Successful in 12s
build-and-push / docker (push) Successful in 1m13s
2025-12-31 13:28:30 +00:00
nocci
943fdbbf0c fix: check remember-me and handle split email/password epic login 2025-12-31 13:27:59 +00:00
nocci
f5e404329f chore: fix lint extra parens in new epic claimer
All checks were successful
build-and-push / lint (push) Successful in 5s
build-and-push / sonar (push) Successful in 12s
build-and-push / docker (push) Successful in 1m13s
2025-12-31 13:21:51 +00:00
nocci
1c34648112 fix: detect cloudflare challenge and wait for manual solve in new epic claimer
Some checks failed
build-and-push / lint (push) Failing after 4s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
2025-12-31 13:18:28 +00:00
nocci
1a34d8f0e4 fix: force epic login page and autofill password when email prefilled
All checks were successful
build-and-push / lint (push) Successful in 4s
build-and-push / sonar (push) Successful in 13s
build-and-push / docker (push) Successful in 1m13s
2025-12-31 13:13:16 +00:00
nocci
5c7a945be0 fix: fall back to manual login when epic device code api fails
All checks were successful
build-and-push / lint (push) Successful in 4s
build-and-push / sonar (push) Successful in 11s
build-and-push / docker (push) Successful in 1m9s
2025-12-31 13:04:00 +00:00
nocci
051363ed5f chore: fix lint (no extra parens) in new epic claimer
All checks were successful
build-and-push / sonar (push) Successful in 12s
build-and-push / lint (push) Successful in 4s
build-and-push / docker (push) Successful in 1m13s
2025-12-31 12:57:39 +00:00
nocci
2908cbd1f5 chore: fix lint in new epic claimer
Some checks failed
build-and-push / lint (push) Failing after 5s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
2025-12-31 12:55:52 +00:00
nocci
bf0625de8b fix: auto-fill epic login in new claimer to avoid timeout
Some checks failed
build-and-push / lint (push) Failing after 4s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
2025-12-31 12:47:23 +00:00
nocci
d05c184156 feat: enhance new epic claimer with cookie persistence and oauth device flow
Some checks failed
build-and-push / lint (push) Failing after 4s
build-and-push / sonar (push) Has been skipped
build-and-push / docker (push) Has been skipped
2025-12-31 12:30:02 +00:00
nocci
7a9f31df7c feat: add optional new epic claimer mode
All checks were successful
build-and-push / lint (push) Successful in 5s
build-and-push / sonar (push) Successful in 12s
build-and-push / docker (push) Successful in 1m13s
2025-12-31 12:25:07 +00:00