mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
* 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>
22 lines
529 B
TypeScript
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),
|
|
};
|
|
}
|
|
}
|