Set scopes for Google Provider on signIn in Next Auth 4 #4557
-
In the previous version, there was undocumented In Next Auth 4 it is missing in the source code. https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/providers/google.ts |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think I found in the docs, is that right? https://next-auth.js.org/configuration/providers/oauth#authorization-option authorization: {
url: "https://example.com/oauth/authorization",
params: { scope: "email" }
} |
Beta Was this translation helpful? Give feedback.
-
You can do like this: authorization: {
params: {
scope: [
"openid",
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile",
// and more scope urls
].join(" "),
prompt: "consent",
access_type: "offline",
response_type: "code",
},
}, |
Beta Was this translation helpful? Give feedback.
You can do like this: