mirror of
https://github.com/outline/outline.git
synced 2026-11-21 05:24:03 +03:00
- Remove unused IntegrationService import in UploadGitLabProjectAvatarTask - Replace 'any' type with proper types in gitlab.ts and OIDCStrategy.ts
30 lines
831 B
TypeScript
30 lines
831 B
TypeScript
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
import OAuth2Strategy, { Strategy } from "passport-oauth2";
|
|
import { Request } from "express";
|
|
|
|
export class OIDCStrategy extends Strategy {
|
|
constructor(
|
|
options: OAuth2Strategy.StrategyOptionsWithRequest,
|
|
verify: OAuth2Strategy.VerifyFunctionWithRequest
|
|
) {
|
|
super(options, verify);
|
|
|
|
if (process.env.https_proxy) {
|
|
const httpsProxyAgent = new HttpsProxyAgent(process.env.https_proxy);
|
|
this._oauth2.setAgent(httpsProxyAgent);
|
|
}
|
|
}
|
|
|
|
authenticate(req: Request, options: Record<string, unknown>) {
|
|
options.originalQuery = req.query;
|
|
super.authenticate(req, options);
|
|
}
|
|
|
|
authorizationParams(options: Record<string, unknown>) {
|
|
return {
|
|
...options.originalQuery,
|
|
...super.authorizationParams?.(options),
|
|
};
|
|
}
|
|
}
|