diff --git a/packages/auth/src/middleware/passport/google.js b/packages/auth/src/middleware/passport/google.js
index cb93844c31..efe64d6337 100644
--- a/packages/auth/src/middleware/passport/google.js
+++ b/packages/auth/src/middleware/passport/google.js
@@ -46,6 +46,7 @@ exports.strategyFactory = async function (
clientID: config.clientID,
clientSecret: config.clientSecret,
callbackURL: callbackUrl,
+ store: true,
},
verify
)
diff --git a/packages/builder/src/components/backend/DatasourceNavigator/_components/GoogleButton.svelte b/packages/builder/src/components/backend/DatasourceNavigator/_components/GoogleButton.svelte
new file mode 100644
index 0000000000..81b0d3370f
--- /dev/null
+++ b/packages/builder/src/components/backend/DatasourceNavigator/_components/GoogleButton.svelte
@@ -0,0 +1,44 @@
+
+
+ {
+ // TODO: can probably remove
+ const datasourceId = await preAuthStep()
+ window.open(
+ `/api/global/auth/${tenantId}/google2?datasourceId=${datasourceId}&appId=${$store.appId}`,
+ "_blank"
+ )
+ }}
+>
+
+
+
Sign in with Google
+
+
+
+
diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte
index 1a433785dc..929f8e71c4 100644
--- a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte
+++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte
@@ -32,6 +32,7 @@
plus: selected.plus,
config,
schema: selected.datasource,
+ auth: selected.auth,
}
}
diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte
index ffd908b101..819e2e1410 100644
--- a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte
+++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte
@@ -6,6 +6,7 @@
import { datasources, tables } from "stores/backend"
import { IntegrationNames } from "constants"
import cloneDeep from "lodash/cloneDeepWith"
+ import GoogleButton from "../_components/GoogleButton.svelte"
export let integration
export let modal
@@ -33,11 +34,14 @@
return datasource
}
- async function saveDatasource() {
+ async function saveDatasource(fetchSchema) {
const datasource = prepareData()
try {
// Create datasource
- const resp = await datasources.save(datasource, datasource.plus)
+ const resp = await datasources.save(
+ datasource,
+ fetchSchema ?? datasource.plus
+ )
// update the tables incase data source plus
await tables.fetch()
@@ -48,7 +52,7 @@
name: resp.name,
source: resp.source,
})
- return true
+ return resp._id
} catch (err) {
notifications.error(`Error saving datasource: ${err}`)
return false
@@ -71,8 +75,11 @@
>Connect your database to Budibase using the config below.