Replies: 4 comments
-
Hey! Working on the same thing: Login in with google on the backend, create a session cookie, and redirect to the nuxt app. It's confusing as hell and I don't have a working example yet... |
Beta Was this translation helpful? Give feedback.
-
Working on the same thing, may be you need to implement your own google signin, instead of using the google signin that comes with the auth module.
strategies: {
cookie: {
cookie: {},
user: {
property: 'user',
autoFetch: true,
},
endpoints: {
login: { url: '/signin', method: 'post' },
logout: { url: '/signout', method: 'get' },
user: { url: '/user_info', method: 'get' },
},
},
customGoogle: {
scheme: 'cookie',
cookie: {},
user: {
property: 'user',
autoFetch: true,
},
endpoints: {
login: { url: '/google_login', method: 'post' },
logout: { url: '/signout', method: 'get' },
user: { url: '/user_info', method: 'get' },
},
},
},
},
<button v-google-signin-button="googleClientId" class="button is-white px-6 py-2" style="width: 100%">
<svg class="icon mr-2" aria-hidden="true" style="font-size: 20px">
<use xlink:href="#icon-google"></use>
</svg>
{{ $t('auth.signinWithGoogle') }}
</button>
const OnGoogleAuthSuccess = (idToken: string) => {
if (idToken) {
$auth
.loginWith('customGoogle', { data: { idToken, continue: getQueryString('continue') } })
}
} |
Beta Was this translation helpful? Give feedback.
-
I have the same problem, I'm trying to set a Google sign in button back the backend works with cookie based authentication and I'm not able no achieve that the requests are sent to the server with the custom params I need. |
Beta Was this translation helpful? Give feedback.
-
We solved this problem using the native google strategy. In fact, everything works out of the box, but it took us a lot of time to debug this kind of authorization. |
Beta Was this translation helpful? Give feedback.
-
Hi guys, there is such a question, I have @ nuxt / auth-next installed, now there is such a need to make oauth2 for google, the authorization will then be intercepted by the backend and set the authorization cookie (XSRF token), but since google authorization uses the oauth scheme and not cookie, it turns out that I am not authorized for nuxt / auth-next, do you have any ideas / suggestions? Can anyone come across this?
P.S. : I know that these are different schemes, but I can't solve the problem with authorization
Config:
Beta Was this translation helpful? Give feedback.
All reactions