Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.

Commit 28f5229

Browse files
Updated Google Provider example to work with new version (v4) (#59)
* Updated references to work with new version (v4) - Within the Google Provider, `authorizationUrl` has been renamed to `authorization`. - `verified_email` can be accessed as `email_verified`. * fix: adding code for scenario with multiple providers Co-authored-by: Balázs Orbán <[email protected]>
1 parent 49d346c commit 28f5229

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

docs/providers/google.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,19 @@ const options = {
6666
:::
6767

6868
:::tip
69-
Google also returns a `verified_email` boolean property in the OAuth profile.
69+
Google also returns a `email_verified` boolean property in the OAuth profile.
7070

7171
You can use this property to restrict access to people with verified accounts at a particular domain.
7272

7373
```js
7474
const options = {
7575
...
7676
callbacks: {
77-
async signIn(user, account, profile) {
78-
if (account.provider === 'google' &&
79-
profile.verified_email === true &&
80-
profile.email.endsWith('@example.com')) {
81-
return true
82-
} else {
83-
return false
77+
async signIn({ account, profile }) {
78+
if (account.provider === "google") {
79+
return profile.email_verified && profile.email.endsWith('@example.com')
8480
}
81+
return true // Do different verification for other providers that don't have `email_verified`
8582
},
8683
}
8784
...

0 commit comments

Comments
 (0)