Closed SirMishaa closed 2 months ago
Hey,
What is the full URL where Google is trying to redirect you and what is your local dev URL?
For HTTPS, you could take a look at the arg --https
, https://nuxt.com/docs/api/commands/dev#:~:text=of%20the%20server.-,%2D%2Dhttps,protocol%20with%20a%20self%2Dsigned%20certificate%20by%20default.,-%2D%2Dssl%2Dcert
Hey,
What is the full URL where Google is trying to redirect you and what is your local dev URL?
For HTTPS, you could take a look at the arg
--https
, https://nuxt.com/docs/api/commands/dev#:~:text=of%20the%20server.-,%2D%2Dhttps,protocol%20with%20a%20self%2Dsigned%20certificate%20by%20default.,-%2D%2Dssl%2Dcert
My local URL : https://mishaa.io:3000/ The google redirection url : https://mishaa.io:3000/auth/google?code=4/0AQlEd8yY8GErEe1-EoDrtZUJXW00REDACTED00OLBNQ8TgqjKOvKDCUw&scope=email+profile+openid+https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/userinfo.email&authuser=0&prompt=consent
I'm already using HTTPS since it's configured in that way in the configuration of Nuxt.
@SirMishaa
Nuxt is making some changes to the directory layout in version 4 and it's starting to creep into these latest 3.x releases, especially with the compatibility keys in nuxt.config. I ran into 401 errors with my server routes when I upgraded to 3.12.4.
https://nuxt.com/docs/getting-started/upgrade#new-directory-structure
You might compare your project structure to what your config is specifying.
Sorry to hear that it does not work @SirMishaa
Could you try with redirectURL
instead of authorizationParams
?
export default oauthGoogleEventHandler({
config: {
redirectURL: 'https://<REDACTED>:3000/auth/google',
},
// ...
})
Sorry to hear that it does not work @SirMishaa
Could you try with
redirectURL
instead ofauthorizationParams
?export default oauthGoogleEventHandler({ config: { redirectURL: 'https://<REDACTED>:3000/auth/google', }, // ... })
I can confirm this is working. Thank you !
Hello,
Context
When I try to log in with Google, I get the validation promp from Google (basically OAuth works fine), but once it returns to the page with the code provided by Google, there's an error.
Here's the error
Only one file (except tsconfig.json) in the server directory
server/routes/auth/google.get.ts
:I've changed my hosts file to map my domain and enable HTTPS. I'm not behind a PROXY, I just enabled the HTTPS server of Vite (in the nuxt conf) and I'm using WSL 2.
app/pages/login.vue
nuxt.config.ts
:Versions :
Am I doing something wrong? The application is running on development mode