Skip to content

Commit 420e8ea

Browse files
Andrew Farriesroboquat
Andrew Farries
authored andcommitted
Sanitize oauth strategy options before logging
1 parent 4678d6f commit 420e8ea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/server/src/auth/generic-auth-provider.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class GenericAuthProvider implements AuthProvider {
7373
@postConstruct()
7474
init() {
7575
this.initAuthUserSetup();
76-
log.info(`(${this.strategyName}) Initialized.`, { defaultStrategyOptions: this.defaultStrategyOptions });
76+
log.info(`(${this.strategyName}) Initialized.`, { sanitizedStrategyOptions: this.sanitizedStrategyOptions });
7777
}
7878

7979
get info(): AuthProviderInfo {
@@ -756,6 +756,11 @@ export class GenericAuthProvider implements AuthProvider {
756756
return false;
757757
}
758758

759+
protected get sanitizedStrategyOptions(): Omit<StrategyOptionsWithRequest, "clientSecret"> {
760+
const { clientSecret, ...sanitizedOptions } = this.defaultStrategyOptions;
761+
return sanitizedOptions;
762+
}
763+
759764
protected get defaultStrategyOptions(): StrategyOptionsWithRequest {
760765
const {
761766
authorizationUrl,

0 commit comments

Comments
 (0)