nuxt-community / auth-module

Zero-boilerplate authentication support for Nuxt 2
https://auth.nuxtjs.org
MIT License
1.93k stars 925 forks source link

fix(core): fix missing query parameters when router.base is a subdirectory. #1827

Open izumiya opened 1 year ago

izumiya commented 1 year ago

Hello. I have fixed a problem with query parameters being lost even with fullPathRedirect enabled. The problem occurs when a subdirectory is specified in router.base in nuxt.config.js as follows.

export default {
  router: {
    base: '/app/'
  },
  auth: {
    fullPathRedirect: true
  }
}

This problem is caused by normalizePath being executed on the URL retrieved by this.$storage.getUniversal('redirect'). To avoid this problem, I have changed where normalizePath is executed.

For example, if you intended to forward to https://localhost/app/foo?bar=123 after login /foo?bar=123 will be replaced by normalizePath, resulting in a transfer to https://localhost/app/foo. This problem has been resolved in this commit.

Issue is here https://github.com/nuxt-community/auth-module/issues/1828

Thanks for the confirmation.