How to use userbase-server - 3 common examples

To help you get started, we’ve selected a few userbase-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github encrypted-dev / userbase / src / proof-of-concept / server / app.js View on Github external
async function setupAdmin() {
  try {
    let adminPassword = process.env['sm.ADMIN_ACCOUNT_PASSWORD']
    let storePasswordInSecretsManager
    if (!adminPassword) {
      adminPassword = crypto.randomBytes(16).toString('base64')
      storePasswordInSecretsManager = true
    }

    await userbaseServer.createAdmin(ADMIN_NAME, adminPassword, ADMIN_ID, storePasswordInSecretsManager)
  } catch (e) {
    if (!e || e.status !== CONFLICT_STATUS_CODE) {
      console.log(`Failed to set up new admin account with ${JSON.stringify(e)}`)
    }
  }
}
github encrypted-dev / userbase / src / proof-of-concept / server / app.js View on Github external
async function setupApp() {
  try {
    await userbaseServer.createApp(APP_NAME, ADMIN_ID, APP_ID)
  } catch (e) {
    if (!e || e.status !== CONFLICT_STATUS_CODE) {
      console.log(`Failed to set up new app with ${JSON.stringify(e)}`)
    }
  }
}
github encrypted-dev / userbase / src / proof-of-concept / server / app.js View on Github external
async function start() {
  app.use(cors())
  app.use(express.static(distDir))
  await userbaseServer.start(express, app, userbaseConfig)

  await setupAdmin()
  await setupApp()
}

userbase-server

Userbase server built for Express

MIT
Latest version published 1 year ago

Package Health Score

52 / 100
Full package analysis