auth-module
auth-module copied to clipboard
Setting redirect.callback = false is not supported and throws an error
Version
module: auth-next@^5.0.0-1643791578.532b3d6 nuxt: 2.15.8
Nuxt configuration
mode:
- [x ] universal
- [ ] spa
Nuxt configuration
auth: {
strategies: {
google: {
clientId:
"xxxx",
codeChallengeMethod: "",
responseType: "code",
redirectUri: frontEndUrl + "/oauth/google",
},
},
redirect: {
login: "/login",
logout: false,
callback: false,
home: false,
},
rewriteRedirects: true,
},
What is expected?
As mentioned by the docs: Each redirect path can be disabled by setting to false. Also you can disable all redirects by setting redirect to false
What is actually happening?
If I set the callback redirect to false
the module still tries to fetch it as it only checks if the whole redirect object is set
async _handleCallback() {
if (this.$auth.options.redirect && normalizePath(this.$auth.ctx.route.path, this.$auth.ctx) !== normalizePath(this.$auth.options.redirect.callback, this.$auth.ctx)) {
return;
}
Then normalizePath gets as first param false
and throws an error

Not sure why, if I call the method a second time it prepends the false
with // and //false
becomes an acceptable string param for normalizePath and it works.