Skip to content

Commit 73a4f0b

Browse files
authored
mention getAdditionalUserInfo() in oauth providers (#319)
1 parent b48560b commit 73a4f0b

19 files changed

+47
-5
lines changed

auth-next/apple.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function appleSignInPopup(provider) {
3838
const accessToken = credential.accessToken;
3939
const idToken = credential.idToken;
4040

41+
// IdP data available using getAdditionalUserInfo(result)
4142
// ...
4243
})
4344
.catch((error) => {

auth-next/facebook.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function facebookSignInPopup(provider) {
3333
const credential = FacebookAuthProvider.credentialFromResult(result);
3434
const accessToken = credential.accessToken;
3535

36+
// IdP data available using getAdditionalUserInfo(result)
3637
// ...
3738
})
3839
.catch((error) => {
@@ -61,6 +62,8 @@ function facebookSignInRedirectResult() {
6162
const token = credential.accessToken;
6263

6364
const user = result.user;
65+
// IdP data available using getAdditionalUserInfo(result)
66+
// ...
6467
}).catch((error) => {
6568
// Handle Errors here.
6669
const errorCode = error.code;

auth-next/github.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function githubSignInPopup(provider) {
4040

4141
// The signed-in user info.
4242
const user = result.user;
43+
// IdP data available using getAdditionalUserInfo(result)
4344
// ...
4445
}).catch((error) => {
4546
// Handle Errors here.
@@ -70,6 +71,8 @@ function githubSignInRedirectResult() {
7071

7172
// The signed-in user info.
7273
const user = result.user;
74+
// IdP data available using getAdditionalUserInfo(result)
75+
// ...
7376
}).catch((error) => {
7477
// Handle Errors here.
7578
const errorCode = error.code;

auth-next/google-signin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function googleSignInPopup(provider) {
3333
const token = credential.accessToken;
3434
// The signed-in user info.
3535
const user = result.user;
36+
// IdP data available using getAdditionalUserInfo(result)
3637
// ...
3738
}).catch((error) => {
3839
// Handle Errors here.
@@ -60,6 +61,8 @@ function googleSignInRedirectResult() {
6061

6162
// The signed-in user info.
6263
const user = result.user;
64+
// IdP data available using getAdditionalUserInfo(result)
65+
// ...
6366
}).catch((error) => {
6467
// Handle Errors here.
6568
const errorCode = error.code;

auth-next/twitter.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function twitterSignInPopup(provider) {
3030

3131
// The signed-in user info.
3232
const user = result.user;
33+
// IdP data available using getAdditionalUserInfo(result)
3334
// ...
3435
}).catch((error) => {
3536
// Handle Errors here.
@@ -60,6 +61,8 @@ function twitterSignInRedirectResult() {
6061

6162
// The signed-in user info.
6263
const user = result.user;
64+
// IdP data available using getAdditionalUserInfo(result)
65+
// ...
6366
}).catch((error) => {
6467
// Handle Errors here.
6568
const errorCode = error.code;

auth/apple.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ function appleSignInPopup(provider) {
4040
var accessToken = credential.accessToken;
4141
var idToken = credential.idToken;
4242

43-
// ...
43+
// IdP data available using getAdditionalUserInfo(result)
44+
// ...
4445
})
4546
.catch((error) => {
4647
// Handle Errors here.
@@ -77,6 +78,7 @@ function appleSignInRedirectResult() {
7778
var accessToken = credential.accessToken;
7879
var idToken = credential.idToken;
7980

81+
// IdP data available in result.additionalUserInfo.profile.
8082
// ...
8183
}
8284
// The signed-in user info.
@@ -117,7 +119,8 @@ function appleReauthenticatePopup() {
117119
var accessToken = credential.accessToken;
118120
var idToken = credential.idToken;
119121

120-
// ...
122+
// IdP data available in result.additionalUserInfo.profile.
123+
// ...
121124
})
122125
.catch((error) => {
123126
// Handle Errors here.

auth/facebook.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ function facebookSignInPopup(provider) {
3131

3232
// The signed-in user info.
3333
var user = result.user;
34+
// IdP data available in result.additionalUserInfo.profile.
35+
// ...
3436

3537
// This gives you a Facebook Access Token. You can use it to access the Facebook API.
3638
var accessToken = credential.accessToken;
@@ -66,6 +68,8 @@ function facebookSignInRedirectResult() {
6668
}
6769
// The signed-in user info.
6870
var user = result.user;
71+
// IdP data available in result.additionalUserInfo.profile.
72+
// ...
6973
}).catch((error) => {
7074
// Handle Errors here.
7175
var errorCode = error.code;

auth/github.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ function githubSignInPopup(provider) {
4040

4141
// The signed-in user info.
4242
var user = result.user;
43-
// ...
43+
// IdP data available in result.additionalUserInfo.profile.
44+
// ...
4445
}).catch((error) => {
4546
// Handle Errors here.
4647
var errorCode = error.code;
@@ -70,6 +71,8 @@ function githubSignInRedirectResult() {
7071

7172
// The signed-in user info.
7273
var user = result.user;
74+
// IdP data available in result.additionalUserInfo.profile.
75+
// ...
7376
}).catch((error) => {
7477
// Handle Errors here.
7578
var errorCode = error.code;

auth/google-signin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ function googleSignInPopup(provider) {
3434
var token = credential.accessToken;
3535
// The signed-in user info.
3636
var user = result.user;
37-
// ...
37+
// IdP data available in result.additionalUserInfo.profile.
38+
// ...
3839
}).catch((error) => {
3940
// Handle Errors here.
4041
var errorCode = error.code;
@@ -63,6 +64,8 @@ function googleSignInRedirectResult() {
6364
}
6465
// The signed-in user info.
6566
var user = result.user;
67+
// IdP data available in result.additionalUserInfo.profile.
68+
// ...
6669
}).catch((error) => {
6770
// Handle Errors here.
6871
var errorCode = error.code;

auth/twitter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ function twitterSignInPopup(provider) {
3232

3333
// The signed-in user info.
3434
var user = result.user;
35-
// ...
35+
// IdP data available in result.additionalUserInfo.profile.
36+
// ...
3637
}).catch((error) => {
3738
// Handle Errors here.
3839
var errorCode = error.code;
@@ -64,6 +65,8 @@ function twitterSignInRedirectResult() {
6465

6566
// The signed-in user info.
6667
var user = result.user;
68+
// IdP data available in result.additionalUserInfo.profile.
69+
// ...
6770
}).catch((error) => {
6871
// Handle Errors here.
6972
var errorCode = error.code;

snippets/auth-next/apple/auth_apple_signin_popup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ signInWithPopup(auth, provider)
1818
const accessToken = credential.accessToken;
1919
const idToken = credential.idToken;
2020

21+
// IdP data available using getAdditionalUserInfo(result)
2122
// ...
2223
})
2324
.catch((error) => {

snippets/auth-next/facebook/auth_facebook_signin_popup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ signInWithPopup(auth, provider)
1717
const credential = FacebookAuthProvider.credentialFromResult(result);
1818
const accessToken = credential.accessToken;
1919

20+
// IdP data available using getAdditionalUserInfo(result)
2021
// ...
2122
})
2223
.catch((error) => {

snippets/auth-next/facebook/auth_facebook_signin_redirect_result.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ getRedirectResult(auth)
1515
const token = credential.accessToken;
1616

1717
const user = result.user;
18+
// IdP data available using getAdditionalUserInfo(result)
19+
// ...
1820
}).catch((error) => {
1921
// Handle Errors here.
2022
const errorCode = error.code;

snippets/auth-next/github/auth_github_signin_popup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ signInWithPopup(auth, provider)
1616

1717
// The signed-in user info.
1818
const user = result.user;
19+
// IdP data available using getAdditionalUserInfo(result)
1920
// ...
2021
}).catch((error) => {
2122
// Handle Errors here.

snippets/auth-next/github/auth_github_signin_redirect_result.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ getRedirectResult(auth)
1919

2020
// The signed-in user info.
2121
const user = result.user;
22+
// IdP data available using getAdditionalUserInfo(result)
23+
// ...
2224
}).catch((error) => {
2325
// Handle Errors here.
2426
const errorCode = error.code;

snippets/auth-next/google-signin/auth_google_signin_popup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ signInWithPopup(auth, provider)
1515
const token = credential.accessToken;
1616
// The signed-in user info.
1717
const user = result.user;
18+
// IdP data available using getAdditionalUserInfo(result)
1819
// ...
1920
}).catch((error) => {
2021
// Handle Errors here.

snippets/auth-next/google-signin/auth_google_signin_redirect_result.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ getRedirectResult(auth)
1616

1717
// The signed-in user info.
1818
const user = result.user;
19+
// IdP data available using getAdditionalUserInfo(result)
20+
// ...
1921
}).catch((error) => {
2022
// Handle Errors here.
2123
const errorCode = error.code;

snippets/auth-next/twitter/auth_twitter_signin_popup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ signInWithPopup(auth, provider)
1818

1919
// The signed-in user info.
2020
const user = result.user;
21+
// IdP data available using getAdditionalUserInfo(result)
2122
// ...
2223
}).catch((error) => {
2324
// Handle Errors here.

snippets/auth-next/twitter/auth_twitter_signin_redirect_result.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ getRedirectResult(auth)
1919

2020
// The signed-in user info.
2121
const user = result.user;
22+
// IdP data available using getAdditionalUserInfo(result)
23+
// ...
2224
}).catch((error) => {
2325
// Handle Errors here.
2426
const errorCode = error.code;

0 commit comments

Comments
 (0)