Make all OAuth 2.0 fields optional

Closes mountain-loop/yaak#165
This commit is contained in:
Gregory Schier
2025-02-21 13:40:05 -08:00
parent d9a1e124f5
commit 597b5bb783

View File

@@ -103,19 +103,27 @@ export const plugin: PluginDefinition = {
defaultValue: defaultGrantType, defaultValue: defaultGrantType,
options: grantTypes, options: grantTypes,
}, },
// Always-present fields // Always-present fields
{ type: 'text', name: 'clientId', label: 'Client ID' }, {
type: 'text',
name: 'clientId',
label: 'Client ID',
optional: true,
},
{ {
type: 'text', type: 'text',
name: 'clientSecret', name: 'clientSecret',
label: 'Client Secret', label: 'Client Secret',
optional: true,
password: true, password: true,
dynamic: hiddenIfNot(['authorization_code', 'password', 'client_credentials']), dynamic: hiddenIfNot(['authorization_code', 'password', 'client_credentials']),
}, },
{ {
type: 'text', type: 'text',
name: 'authorizationUrl', name: 'authorizationUrl',
optional: true,
label: 'Authorization URL', label: 'Authorization URL',
dynamic: hiddenIfNot(['authorization_code', 'implicit']), dynamic: hiddenIfNot(['authorization_code', 'implicit']),
placeholder: authorizationUrls[0], placeholder: authorizationUrls[0],
@@ -124,6 +132,7 @@ export const plugin: PluginDefinition = {
{ {
type: 'text', type: 'text',
name: 'accessTokenUrl', name: 'accessTokenUrl',
optional: true,
label: 'Access Token URL', label: 'Access Token URL',
placeholder: accessTokenUrls[0], placeholder: accessTokenUrls[0],
dynamic: hiddenIfNot(['authorization_code', 'password', 'client_credentials']), dynamic: hiddenIfNot(['authorization_code', 'password', 'client_credentials']),