From 597b5bb783c6c72703ff1218f31610b3068f51b1 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 21 Feb 2025 13:40:05 -0800 Subject: [PATCH] Make all OAuth 2.0 fields optional Closes mountain-loop/yaak#165 --- plugins/auth-oauth2/src/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/auth-oauth2/src/index.ts b/plugins/auth-oauth2/src/index.ts index 31e2b6ce..cb03dfae 100644 --- a/plugins/auth-oauth2/src/index.ts +++ b/plugins/auth-oauth2/src/index.ts @@ -103,19 +103,27 @@ export const plugin: PluginDefinition = { defaultValue: defaultGrantType, options: grantTypes, }, + // Always-present fields - { type: 'text', name: 'clientId', label: 'Client ID' }, + { + type: 'text', + name: 'clientId', + label: 'Client ID', + optional: true, + }, { type: 'text', name: 'clientSecret', label: 'Client Secret', + optional: true, password: true, dynamic: hiddenIfNot(['authorization_code', 'password', 'client_credentials']), }, { type: 'text', name: 'authorizationUrl', + optional: true, label: 'Authorization URL', dynamic: hiddenIfNot(['authorization_code', 'implicit']), placeholder: authorizationUrls[0], @@ -124,6 +132,7 @@ export const plugin: PluginDefinition = { { type: 'text', name: 'accessTokenUrl', + optional: true, label: 'Access Token URL', placeholder: accessTokenUrls[0], dynamic: hiddenIfNot(['authorization_code', 'password', 'client_credentials']),