Skip to content

Commit 85e3cad

Browse files
committed
Fix Request type extension to not use namespacing
1 parent 5d7bc7a commit 85e3cad

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/server/auth/middleware/clientAuth.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@ export type ClientAuthenticationMiddlewareOptions = {
1313
const ClientAuthenticatedRequestSchema = z.object({
1414
client_id: z.string(),
1515
client_secret: z.string().optional(),
16-
})
16+
});
1717

18-
declare global {
19-
namespace Express {
20-
interface Request {
21-
/**
22-
* The authenticated client for this request, if the `authenticateClient` middleware was used.
23-
*/
24-
client?: OAuthClientInformationFull;
25-
}
18+
declare module "express-serve-static-core" {
19+
interface Request {
20+
/**
21+
* The authenticated client for this request, if the `authenticateClient` middleware was used.
22+
*/
23+
client?: OAuthClientInformationFull;
2624
}
2725
}
2826

0 commit comments

Comments
 (0)