I have the following authentication strategy:
auth: {
strategies: {
local: {
...,
},
google: {
clientId:
"<MY CLIENT ID>",
responseType: "code",
endpoints: {
token: "http://localhost:8000/social-login/google/",
userInfo: "http://localhost:8000/auth/user/",
},
},
},
redirect: {
...
},
},
Oddly enough, this strategy completes all the authentication by itself, without ever hitting my backend! Shouldn't responseType code
go to endpoints.token
to get the token?
My login function looks like this:
loginWithGoogle() {
this.$auth.loginWith("google", {
params: {
client_id:
"<MY CLIENT ID>",
},
});
},
Interestingly enough, if I don't pass the params here, Google gives me an error that client_id
is missing.
This is a problem with
@nuxtjs/auth
, which is the version <=v4.9.1
, and as the documentation warns that it may contain bugs and un-implemented functionalities.Using
v5
, named@nuxtjs/auth-next
would fix the issue.Install as:
Then add to your
nuxt.config.js
as (from the documentation):