POC: Add Frontegg authentication provider alongside SuperTokens #1212
+1,453
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements a parallel Frontegg authentication system to evaluate as a potential replacement for SuperTokens. All existing SuperTokens code remains unchanged and operational.
Backend
New Components:
frontegg.middleware.ts- Context initialization, CORS configurationfrontegg.auth.service.ts- Token validation, session revocation, user lookupfrontegg.auth.middleware.ts- JWT verification middleware for protected routesfrontegg.controller.ts- Health check and auth endpointsfrontegg.routes.config.ts- Route bindingsIntegration:
New Endpoints:
GET /api/frontegg/health- Configuration statusGET /api/frontegg/auth/verify- Session validation (requires Bearer token)GET /api/frontegg/auth/me- User details (requires Bearer token)POST /api/frontegg/auth/session/revoke- Session termination (dev only)Frontend
New Components:
FronteggProvider.tsx- React context wrapper with hosted login boxfrontegg.util.ts- Auth state hooks and helpersUsage:
Configuration
Optional environment variables (backend):
Optional environment variables (frontend):
System degrades gracefully when unconfigured - no impact on existing auth flows.
Documentation
FRONTEGG_POC.md- Architecture, session management, migration considerations, SuperTokens comparisonFRONTEGG_QUICKSTART.md- Setup and testing instructionsTesting Checklist
Remaining work to validate POC:
Notes
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.