changed "master" databse to "clientAppLookup"
This commit is contained in:
parent
735d9c4475
commit
108fa4ca13
|
@ -36,7 +36,7 @@ exports.create = async function(ctx) {
|
|||
}
|
||||
const appId = newid()
|
||||
// insert an appId -> clientId lookup
|
||||
const masterDb = new CouchDB("master")
|
||||
const masterDb = new CouchDB("clientAppLookup")
|
||||
await masterDb.put({
|
||||
_id: appId,
|
||||
clientId,
|
||||
|
@ -113,7 +113,7 @@ const createEmptyAppPackage = async (ctx, app) => {
|
|||
}
|
||||
|
||||
const lookupClientId = async appId => {
|
||||
const masterDb = new CouchDB("master")
|
||||
const masterDb = new CouchDB("clientAppLookup")
|
||||
const { clientId } = await masterDb.get(appId)
|
||||
return clientId
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ exports.authenticate = async ctx => {
|
|||
if (!username) ctx.throw(400, "Username Required.")
|
||||
if (!password) ctx.throw(400, "Password Required")
|
||||
|
||||
const masterDb = new CouchDB("master")
|
||||
const masterDb = new CouchDB("clientAppLookup")
|
||||
const { clientId } = await masterDb.get(ctx.params.appId)
|
||||
|
||||
if (!clientId) {
|
||||
|
|
|
@ -7,7 +7,7 @@ const {
|
|||
} = require("../../utilities/budibaseDir")
|
||||
|
||||
exports.fetchAppComponentDefinitions = async function(ctx) {
|
||||
const masterDb = new CouchDB("master")
|
||||
const masterDb = new CouchDB("clientAppLookup")
|
||||
const { clientId } = await masterDb.get(ctx.params.appId)
|
||||
const db = new CouchDB(ClientDb.name(clientId))
|
||||
const app = await db.get(ctx.params.appId)
|
||||
|
|
|
@ -8,7 +8,7 @@ exports.create = async function(ctx) {
|
|||
const instanceId = `inst_${appShortId}_${newid()}`
|
||||
const { applicationId } = ctx.params
|
||||
|
||||
const masterDb = new CouchDB("master")
|
||||
const masterDb = new CouchDB("clientAppLookup")
|
||||
const { clientId } = await masterDb.get(applicationId)
|
||||
|
||||
const db = new CouchDB(instanceId)
|
||||
|
|
|
@ -41,7 +41,7 @@ exports.create = async function(ctx) {
|
|||
|
||||
const response = await database.post(user)
|
||||
|
||||
const masterDb = new CouchDB("master")
|
||||
const masterDb = new CouchDB("clientAppLookup")
|
||||
const { clientId } = await masterDb.get(appId)
|
||||
|
||||
// the clientDB needs to store a map of users against the app
|
||||
|
|
Loading…
Reference in New Issue