How vahapgencdal/auth_test_api works
This small Next.js application exposes a token-checking API alongside a generated starter homepage. The main runtime path is an API request through CORS middleware to the connect handler, which calls the token validator and returns a JSON response. The validator decodes the token payload and checks issuer and scope against environment configuration. The handler’s destructuring expects a decodedPayload property, although the validator returns the payload directly on success; this graph shows the implemented call and response path, not a guarantee of successful output. The README describes the Next.js starter, and no additional product capabilities are documented.
Main entry points: connect.ts Connect endpoint · auth.ts Token validation · middleware.js API CORS · index.tsx Starter homepage
Components 7
Web UI
- Starter homepage
pages/index.tsx - App wrapper
pages/_app.tsx
API and Auth
- Connect endpoint
pages/api/connect.ts - Token validation
utils/auth.ts
Request Middleware
- API CORS
middleware.js
Other components
- Site visitor
- API caller
Connections 7
- Site visitor → Starter homepage: opens page
- App wrapper → Starter homepage: renders page
- API caller → API CORS: sends API request
- API CORS → Connect endpoint: continues request
- Connect endpoint → Token validation: validates token
- Token validation → Connect endpoint: returns payload
- Connect endpoint → API caller: returns JSON