mirror of
https://github.com/outline/outline.git
synced 2026-11-27 16:08:58 +03:00
fix: Fix TypeScript type issues in OIDCStrategy.ts
This commit is contained in:
1 parent
07dc974337
commit
948ac02c5e
1 file changed
+11
-3
@@ -1,7 +1,15 @@
|
||||
import { HttpsProxyAgent } from "https-proxy-agent";
|
||||
import { Strategy, StrategyOptionsWithRequest, VerifyFunctionWithRequest } from "passport-oauth2";
|
||||
import {
|
||||
Strategy,
|
||||
StrategyOptionsWithRequest,
|
||||
VerifyFunctionWithRequest,
|
||||
} from "passport-oauth2";
|
||||
import { Request } from "express";
|
||||
|
||||
interface OIDCOptions extends StrategyOptionsWithRequest {
|
||||
originalQuery?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export class OIDCStrategy extends Strategy {
|
||||
constructor(
|
||||
options: StrategyOptionsWithRequest,
|
||||
@@ -16,12 +24,12 @@ export class OIDCStrategy extends Strategy {
|
||||
}
|
||||
|
||||
authenticate(req: Request, options?: Record<string, unknown>) {
|
||||
const opts = options || {};
|
||||
const opts = options ? { ...options } : ({} as OIDCOptions);
|
||||
opts.originalQuery = req.query;
|
||||
super.authenticate(req, opts);
|
||||
}
|
||||
|
||||
authorizationParams(options: Record<string, unknown>) {
|
||||
authorizationParams(options: OIDCOptions) {
|
||||
return {
|
||||
...options.originalQuery,
|
||||
...super.authorizationParams?.(options),
|
||||
|
||||
Reference in new issue
Block a user