Auth-module: auth middleware redirect without host prefix when directly access using url

Created on 3 Apr 2019  路  5Comments  路  Source: nuxt-community/auth-module

Version

v4.5.3

Reproduction link

https://auth.nuxtjs.org/

Steps to reproduce

I have a guarded page dashboard. when i manually access guarded page using browser url http://localhost:3000/dashboard , auth middleware not properly redirect to login page.

What is expected ?

unauthorised access to auth middleware guarded should be redirected to http://localhost:3000/auth/login

What is actually happening?

currently auth middleware redirect to /auth/login instead of properly full url http://localhost:3000/auth/login

Additional comments?

my other dependencies

"dependencies": {
    "@nuxtjs/auth": "^4.5.3",
    "@nuxtjs/axios": "^5.4.1",
    "@nuxtjs/pwa": "^2.6.0",
    "cross-env": "^5.2.0",
    "nuxt": "^2.4.0",
    "vuetify": "^1.5.5",
    "vuetify-loader": "^1.2.1"
  },

my auth strategies

auth: {
    strategies: {
      local: {
        endpoints: {
          login: {
            url: 'auth/login', method: 'post', propertyName: 'token'
          },
          user: {
            url: 'me', method: 'get', propertyName: 'data'
          },
          logout: {
            url: 'auth/logout', method: 'get'
          }
        }
      }
    },
    redirect: {
      home: '/dashboard',
      login: 'auth/login',
      logout: '/'
    }
  },

This bug report is available on Nuxt community (#c305)
bug

Most helpful comment

thanks @MathiasCiarlo for highlighted me on related bug re this issue

All 5 comments

Been having issues with this for so long, I just submitted a pull request that fixes it! :)

This is a duplicate of #134.

We need an update really badly.

Throw in some reactions on the pr, so maybe it gets prioritized :)

thanks @MathiasCiarlo for highlighted me on related bug re this issue

Should be fixed in v4.6.0.

Was this page helpful?
0 / 5 - 0 ratings