mirror of
https://github.com/outline/outline.git
synced 2026-12-06 03:05:08 +03:00
Fix TypeScript errors in OIDCStrategy
This commit is contained in:
1 parent
64f51ee40d
commit
5fec2681da
1 file changed
+8
-3
@@ -2,6 +2,10 @@ import { HttpsProxyAgent } from "https-proxy-agent";
|
||||
import OAuth2Strategy, { Strategy } from "passport-oauth2";
|
||||
import { Request } from "express";
|
||||
|
||||
type OIDCOptions = Record<string, unknown> & {
|
||||
originalQuery?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export class OIDCStrategy extends Strategy {
|
||||
constructor(
|
||||
options: OAuth2Strategy.StrategyOptionsWithRequest,
|
||||
@@ -16,14 +20,15 @@ export class OIDCStrategy extends Strategy {
|
||||
}
|
||||
|
||||
authenticate(req: Request, options?: unknown) {
|
||||
const opts = (options || {}) as Record<string, unknown>;
|
||||
opts.originalQuery = req.query;
|
||||
const opts = (options || {}) as OIDCOptions;
|
||||
opts.originalQuery = req.query as Record<string, unknown>;
|
||||
super.authenticate(req, opts);
|
||||
}
|
||||
|
||||
authorizationParams(options: unknown) {
|
||||
const opts = options as OIDCOptions;
|
||||
return {
|
||||
...options.originalQuery,
|
||||
...(opts.originalQuery || {}),
|
||||
...super.authorizationParams?.(options),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user