-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(oauth2): restore callback handling on static sites #453
fix(oauth2): restore callback handling on static sites #453
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #453 +/- ##
===================================
Coverage 100% 100%
===================================
Files 1 1
Lines 2 2
===================================
Hits 2 2 Continue to review full report at Codecov.
|
Thanks for the PR! |
@pi0 Do you know when a new version with be published with this fix? |
I is already published :) |
@pi0 @jakul does the If we are certain it always happens ssr, I propose we only handle callbacks server side: // Fetching token with authorization code should only be done server side
if (process.client) {
// Redirect to home
this.$auth.redirect('home', true)
return true
} This way we can keep @atinux's change which drastically improves the performance. |
Not in SPA mode. |
Good point! Okay, can we know which mode we are running? I want to do this: if (universalMode && process.client) { |
@jakul do you maybe have some example repo? I'm still seeing this issue with a static site using auth0. When running Update: Managed to fix this by downgrading to 4.7.0 |
@Strahinja Are you using Auth0? My config looks like this and it's working, statically generated and served from Netlify:
|
Nope, I'm not using Auth0. My website repo is at https://github.com/Strahinja/strahinja-org. This is the relevant part of my import authConfig from './auth.config.js';
// ...
auth: {
cookie: {
options: {
expires: 7, // days
},
},
localStorage: false,
plugins: [ { src: '~/plugins/auth.js', mode: 'client' } ],
strategies: {
local: false,
google: {
client_id: authConfig.google.client_id,
},
facebook: {
client_id: authConfig.facebook.client_id,
},
github: {
client_id: authConfig.github.client_id,
client_secret: authConfig.github.client_secret,
},
twitter: {
client_id: authConfig.twitter.client_id,
},
},
redirect: {
login: '/login',
logout: '/',
callback: '/login/callback',
}
},
I feel that Nuxt statically generating |
I tried setting generate: {
//...
exclude: [
/login/,
],
}, but unfortunately nothing changes, auth-module still doesn't pick up parameters from the query/hash. |
I just tried adding middleware: ['auth'], to |
Fixes #299.
Fixes #452.
This fix works for my static Nuxt site, logging into Auth0.