Files
Tom MoorandClaude Opus 4.8 3ffd088624 fix: Consistent usage of configured proxy with auth providers (#13018)
* fix: Consistent usage of configured proxy with auth providers

* lint

* fix: Harden proxy agent helper against missing OAuth2 client

Degrade to a logged warning instead of crashing auth at boot if a
strategy's internal _oauth2 client is ever absent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 19:58:32 -04:00

22 lines
529 B
TypeScript

import type { Request } from "express";
import { Strategy } from "passport-oauth2";
interface AuthenticateOptions {
originalQuery?: Request["query"];
[key: string]: unknown;
}
export class OIDCStrategy extends Strategy {
authenticate(req: Request, options: AuthenticateOptions) {
options.originalQuery = req.query;
super.authenticate(req, options);
}
authorizationParams(options: AuthenticateOptions) {
return {
...options.originalQuery,
...super.authorizationParams?.(options),
};
}
}