使用Next.js的PWA-保留用户登录名

时间:2020-10-30 15:59:51

标签: javascript reactjs next.js progressive-web-apps

我当前正在将PWA与next.js一起使用。目前,我的用户使用Firebase登录,然后可以访问那里的仪表板等。

我遇到的问题是,在移动设备上,每次注销时用户的身份验证都会中断。

我想知道-如果是这种情况,管理PWA身份验证的最佳方法是什么?

这是我使用PWA进行的设置

const withPWA = require('next-pwa')
const runtimeCaching = require('next-pwa/cache')


const withBundleAnalyzer = require('@next/bundle-analyzer')({
    enabled: process.env.ANALYZE === 'true',
  })

module.exports = withPWA({
  pwa: {
    dest: 'public',
    runtimeCaching,
  },
  poweredByHeader: false,
},
withBundleAnalyzer(),

)

{
  "name": "MoodMap",
  "short_name": "MoodMap",
  
  "display": "fullscreen",
  "background_color": "#fdfdfd",
  "theme_color": "#db4938",
  "orientation": "portrait-primary",
  "scope": "/",
  "start_url": "/dashboard/Home",
  "icons": [
    {
      "src": "icons/manifest-icon-192.png",
      "sizes": "192x192",
      "type": "image/png",
      "purpose": "maskable any"
    },
    {
      "src": "icons/Logo_512px.png",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "maskable any"
    },
    {
      "src": "icons/maskable_icon.png",
      "sizes": "540x540",
      "type": "image/png",
      "purpose": "any maskable"
    }
  ],
  "splash_pages": null
}

网站为https://moodmap.app

预先感谢

0 个答案:

没有答案