Skip to content

Commit d0c6e7a

Browse files
committed
Fix auth_type check and console.log
1 parent 44e42b8 commit d0c6e7a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/connect-react/src/hooks/use-app.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ function getCustomFields(app: AppResponse): AppCustomField[] {
6161
}
6262

6363
export function appPropError(prop: ConfigurablePropApp, value: unknown, app: AppResponse | undefined): string | undefined {
64-
console.log("appPropError", prop, value, app)
6564
if (!app) {
6665
return "app field not registered"
6766
}
@@ -77,9 +76,11 @@ export function appPropError(prop: ConfigurablePropApp, value: unknown, app: App
7776
if (app.auth_type === "oauth" && !(_value as OauthAppPropValue).oauth_access_token) {
7877
return "missing oauth token"
7978
}
80-
for (const cf of getCustomFields(app)) {
81-
if (!cf.optional && !_value[cf.name]) {
82-
return "missing custom field"
79+
if (app.auth_type === "oauth" || app.auth_type === "keys") {
80+
for (const cf of getCustomFields(app)) {
81+
if (!cf.optional && !_value[cf.name]) {
82+
return "missing custom field"
83+
}
8384
}
8485
}
8586
return "no auth provision configured"

0 commit comments

Comments
 (0)