mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
21 lines
528 B
TypeScript
21 lines
528 B
TypeScript
import type { NextFunction, NextHandleFunction } from '@fastify/middie';
|
|
|
|
export async function auth0Verify() {
|
|
// Verify user authorization code with Auth0
|
|
}
|
|
|
|
type MiddieRequest = Parameters<NextHandleFunction>[0];
|
|
type MiddieResponse = Parameters<NextHandleFunction>[1];
|
|
|
|
export function testMiddleware(
|
|
req: MiddieRequest,
|
|
res: MiddieResponse,
|
|
next: NextFunction
|
|
) {
|
|
console.log('Test middleware running');
|
|
console.log(req.headers);
|
|
console.log(req.query);
|
|
res.setHeader('X-Test-Header', 'test');
|
|
next();
|
|
}
|