Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/470.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Laravel PWA-会话已过期_Javascript_Laravel_Service Worker_Progressive Web Apps - Fatal编程技术网

Javascript Laravel PWA-会话已过期

Javascript Laravel PWA-会话已过期,javascript,laravel,service-worker,progressive-web-apps,Javascript,Laravel,Service Worker,Progressive Web Apps,所以我用最新的Laravel 5.7构建了一个Web应用程序,它运行得非常好 直到我尝试将其转换为PWA(渐进式Web应用程序) 我用 以下是实现: mix.webpackConfig({ plugins: [ new SWPrecacheWebpackPlugin({ filename: 'service-worker.js', cacheId: 'pwa', staticFileGlobs: ['public/**/*.{css,eo

所以我用最新的Laravel 5.7构建了一个Web应用程序,它运行得非常好

直到我尝试将其转换为PWA(渐进式Web应用程序)

我用
以下是实现:

mix.webpackConfig({
 plugins: [
    new SWPrecacheWebpackPlugin({
      filename: 'service-worker.js',      
      cacheId: 'pwa',
      staticFileGlobs: ['public/**/*.{css,eot,svg,ttf,woff,woff2,js,html,png,jpg}'],
      minify: true,
      stripPrefix: 'public/',
      handleFetch: true,
      ignoreUrlParametersMatching: [/login/,/register/,/^utm_/],
      dynamicUrlToDependencies: {
        '/login':            ['resources/views/auth/login.blade.php'],
        '/register':         ['resources/views/auth/register.blade.php'],
        '/password/reset':   ['resources/views/auth/passwords/email.blade.php'],        
        '/':                 ['resources/views/index.blade.php'],
        '/dream-journal':    ['resources/views/dream-journal.blade.php'],
        '/techniques':       ['resources/views/techniques.blade.php'],
        '/community':        ['resources/views/community.blade.php'],
        '/profile':          ['resources/views/profile.blade.php'],        
        '/settings':         ['resources/views/settings.blade.php']
      },
      staticFileGlobsIgnorePatterns: [/\.map$/, /mix-manifest\.json$/, /manifest\.json$/, /service-worker\.js$/],
      navigateFallback: '/',
      runtimeCaching: [
        {
          urlPattern: /^https:\/\/fonts\.googleapis\.com\//,
          handler: 'cacheFirst'
        },
        {
          urlPattern: /^https:\/\/www\.thecocktaildb\.com\/images\/media\/drink\/(\w+)\.jpg/,
          handler: 'cacheFirst'
        }
      ],
      // importScripts: ['./js/push_message.js']
    })
  ]
});
我还添加了完整的
manifest.json
文件,因此对于“/”、“/login”和“/register”路由(这些路由不需要身份验证),服务工作者实际上已经注册,并且缓存正确

到目前为止,一切都很完美。
问题是-现在当我转到/login或/register表单并提交它时,Laravel抛出一个

419 Sorry, your session has expired. Please refresh and try again.

请帮帮我,我这几天都在努力解决这个问题……

注销操作是一个表单帖子。将csrf密钥(@csrf in blade)添加到您的注销表单中。

问题可能是由于您的会话cookie或csrf令牌也已预缓存,并且您正在发送旧的过期令牌。再检查一遍。我没有用过你用过的上面的图书馆。所以我不能证实这一点。