Open tnabil opened 2 years ago
module: 5.0.0 nuxt: 2.14.12
auth: { localStorage: true, rewriteRedirects: true, strategies: { ping: { scheme: 'oauth2', endpoints: { authorization: process.env.OAUTH_ISSUER + '/as/authorization.oauth2', token: process.env.OAUTH_ISSUER + '/as/token.oauth2', userInfo: process.env.OAUTH_ISSUER + '/idp/userinfo.openid', logout: process.env.OAUTH_ISSUER + '/idp/startSLO.ping' }, token: { property: 'access_token', type: 'Bearer', maxAge: 1800 }, responseType: 'code', grantType: 'authorization_code', clientId: process.env.OAUTH_CLIENT_ID, scope: ['openid', 'profile', 'email'], codeChallengeMethod: 'S256', autoLogout: true, redirectUri: process.env.SITEMAP_URL + '/sso-callback' } }, redirect: { login: '/login', logout: '/logout', callback: '/sso-callback', home: '/' }
:warning: without a minimal reproduction we won't be able to look into your issue
After login, user should be redirected back to the original URL including any query string parameters.
User is redirected to original URL without query string parameters
This is due to this code from auth.ts only saving the route path or full path without the query
auth.ts
const from = this.options.fullPathRedirect ? this.ctx.route.fullPath : this.ctx.route.path let to = this.options.redirect[name] if (!to) { return } // Apply rewrites if (this.options.rewriteRedirects) { if (name === 'login' && isRelativeURL(from) && !isSameURL(to, from)) { this.$storage.setUniversal('redirect', from) } if (name === 'home') { const redirect = this.$storage.getUniversal('redirect') this.$storage.setUniversal('redirect', null) if (isRelativeURL(redirect)) { to = redirect } } }
i have the same problem.
nuxt.config.js
fullPathRedirect: true
begin input url: https://xxxxx/preview?id=1
after login url is changed,id=1 is disappeared. https://xxxxx/preview
Version
module: 5.0.0 nuxt: 2.14.12
Nuxt configuration
mode:
Nuxt configuration
Reproduction
What is expected?
After login, user should be redirected back to the original URL including any query string parameters.
What is actually happening?
User is redirected to original URL without query string parameters
Steps to reproduce
Additional information
This is due to this code from
auth.ts
only saving the route path or full path without the queryChecklist
Steps to reproduce
What is expected?
What is actually happening?
Performance analysis?