Auth module not respecting dynamic router.base (Nuxt 2.15+) #1625
Unanswered
MrNaif2018
asked this question in
Support Requests
Replies: 3 comments
-
Found a workaround (in auth plugin):
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Doesn't seem working for |
Beta Was this translation helpful? Give feedback.
0 replies
This comment was marked as spam.
This comment was marked as spam.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Version
module: 5.0.0-1613647907.37b1156 (same with 4.x.x. series)
nuxt: 2.15.1
Nuxt configuration
mode:
Nuxt configuration
plugins/auth.js
Reproduction
Codesandbox seems to reject process.env, but basically, nuxt.config.js must have:
Then, run
yarn build
.yarn start
- all works as expectedROOTPATH=/admin yarn start
- by opening/admin
, it redirects to/login
and not to/admin/login
.Opening correct page manually all works.
Checklist
What is expected?
A correct redirect to
/admin/login
to be doneWhat is actually happening?
Redirect to
/login
, ignoring router.base.Note: it works if router.base is set statically (not via env var).
So maybe the module is not yet ready for nuxt/nuxt#8520
This second one is what I get after opening localhost:3000/admin:
If possible, could the fix be backported to the 4.x.x series?
Beta Was this translation helpful? Give feedback.
All reactions