Nuxt基本身份验证在Firebase上不起作用

问题描述 投票:0回答:1

我正在研究在Firebase上部署的Nuxt项目。我使用nuxt-basic-auth-module设置了基本身份验证配置。

它在本地工作,但是在Firebase上不工作,这不是我为什么。难道我做错了什么?需要其他设置吗?请给我建议。非常感谢。

nuxt.config.js

import colors from 'vuetify/es5/util/colors'

require('dotenv').config()

export default {
  mode: 'universal',
  head: {
    titleTemplate: '%s - ' + process.env.npm_package_name,
    title: process.env.npm_package_name || '',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },
  loading: { color: '#fff' },
  buildModules: [
    '@nuxtjs/vuetify',
    '@nuxtjs/dotenv'
  ],
  modules: [
    '@nuxtjs/axios', 
    '@nuxtjs/proxy',
    'nuxt-basic-auth-module'
  ],
  build: {
    extend (config, ctx) {
    }
  },
  server: {
    port: 4000, // default: 3000
    host: '0.0.0.0' // default: localhost
  },
  env: {
    baseUrl: process.env.BASE_URL
  },
  basic: {
    name: 'basicauthusername',
    pass: 'basicauthpasswrd1234'
  }
}

firebase vue.js nuxt.js nuxt
1个回答
0
投票

如文档所述,enabled默认带有false

  basic: {
    name: 'basicauthusername',
    pass: 'basicauthpasswrd1234'
    enabled: true // Add this property
  }
© www.soinside.com 2019 - 2024. All rights reserved.