diff --git a/app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx b/app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx index ae65943216..2e58701b40 100644 --- a/app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx +++ b/app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx @@ -534,21 +534,29 @@ class DatasourceRestAPIEditor extends React.Component< {this.renderAuthFields()} {this.renderSelfSignedCertificateFields()} - - - this.save( - redirectAuthorizationCode(pageId, datasourceId, PluginType.API), - ) - } - size="small" - text={isAuthorized ? "Save and Re-Authorize" : "Save and Authorize"} - /> - + {formData.authType && formData.authType === AuthType.OAuth2 && ( + + + this.save( + redirectAuthorizationCode( + pageId, + datasourceId, + PluginType.API, + ), + ) + } + size="small" + text={ + isAuthorized ? "Save and Re-Authorize" : "Save and Authorize" + } + /> + + )} ); };