#sorry/for/no/reproduction/link
1.
in nuxt.config.js
router: {
base: "/some_custom_base_path",
}
auth: {
...
redirect: {
login: '/login',
logout: '/login',
callback: '/some_callback_path',
home: '/'
}
}
2.
try login facebook
Expected redirect to http://mydomain.com/some_custom_base_path/some_callback_path
Happening redirect to http://mydomain.com/some_callback_path
Other redirects working correctly.
Any ideas on this issue so far ?
I'm interested in this one.
Note that you can work around this by making each of the callback values include your base url. So IMHO I would create a const in the config file for the base url and prepend it to each callback.
Auth-module should take the base url into account though, since that's baked into nuxt.
Nevermind, doing what I proposed causes issues with callback routes not matching correctly.
Hi, Just want to add few notes about the Fix I proposed .
document.baseURI for this purpose but it will not work becauserouter.base is not set. In that case, we will get document.location.href as baseurl which is wrong.document.baseURI whenever we use it. That is , we need to use document.baseURI.slice(0,-1) whenever we need to use this value to remove trailing slash.@harish2704 Did you see my PR - #489? I believe my PR covers all of the bases. Let me know if you see something that doesn't work and put a comment on the PR.
Hi @NickBolles ,
I had checked this PR before I start implementing my own solution.
That is why tried to solve this issue by introducing minimum changes to the system.
The changes I proposed has only 4 lines of changes and , I believe it is easily readable and understandable
@harish2704 No doubt that your fix is concise. But i believe it misses multiple scenarios. I will add a few comments to your PR.
@NickBolles @harish2704 do any of you have a workaround, our you're just using your respective forks?
Just include your router base in your auth config urls. So if base = /foo login = /foo/login
Hmmm...
async _handleCallback (uri) {
// Handle callback only for specified route
if (this.$auth.options.redirect && this.$auth.ctx.route.path !== this.$auth.options.redirect.callback) {
ctx.route.path is relative, while redirect.callback is absolute, so the callback code doesn't work...I'm not seeing how your solution solves this?
@blocka your right. Im just using my branch. You can try it out with npm I NickBolles/auth-module#njb/use-router-base and add comments to #489
Most helpful comment
Nevermind, doing what I proposed causes issues with callback routes not matching correctly.