
import VBase from './vbase.js'

export default async ($mod) => {
  // Load i18n
  try {
    const langs = await (await fetch($mod.scoped + '/langs.json')).json()
    $mod.$i18n.load(langs)
  } catch (e) {
    console.error('Failed to load langs.json', e)
  }
  if (!$mod.$auth) {
    $mod.users = {}
    const vbase = new VBase($mod.scoped, null, $mod.users)
    $mod.$auth = vbase
  }
}
