Skip to content

document getAdditionalUserInfo() in oauth provider snippets #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions auth-next/apple.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function appleSignInPopup(provider) {
const accessToken = credential.accessToken;
const idToken = credential.idToken;

// IdP data available using getAdditionalUserInfo(result)
// ...
})
.catch((error) => {
Expand Down
3 changes: 3 additions & 0 deletions auth-next/facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function facebookSignInPopup(provider) {
const credential = FacebookAuthProvider.credentialFromResult(result);
const accessToken = credential.accessToken;

// IdP data available using getAdditionalUserInfo(result)
// ...
})
.catch((error) => {
Expand Down Expand Up @@ -61,6 +62,8 @@ function facebookSignInRedirectResult() {
const token = credential.accessToken;

const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
const errorCode = error.code;
Expand Down
3 changes: 3 additions & 0 deletions auth-next/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function githubSignInPopup(provider) {

// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
Expand Down Expand Up @@ -70,6 +71,8 @@ function githubSignInRedirectResult() {

// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
const errorCode = error.code;
Expand Down
3 changes: 3 additions & 0 deletions auth-next/google-signin.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function googleSignInPopup(provider) {
const token = credential.accessToken;
// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
Expand Down Expand Up @@ -60,6 +61,8 @@ function googleSignInRedirectResult() {

// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
const errorCode = error.code;
Expand Down
3 changes: 3 additions & 0 deletions auth-next/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function twitterSignInPopup(provider) {

// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
Expand Down Expand Up @@ -60,6 +61,8 @@ function twitterSignInRedirectResult() {

// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
const errorCode = error.code;
Expand Down
7 changes: 5 additions & 2 deletions auth/apple.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ function appleSignInPopup(provider) {
var accessToken = credential.accessToken;
var idToken = credential.idToken;

// ...
// IdP data available using getAdditionalUserInfo(result)
// ...
})
.catch((error) => {
// Handle Errors here.
Expand Down Expand Up @@ -77,6 +78,7 @@ function appleSignInRedirectResult() {
var accessToken = credential.accessToken;
var idToken = credential.idToken;

// IdP data available in result.additionalUserInfo.profile.
// ...
}
// The signed-in user info.
Expand Down Expand Up @@ -117,7 +119,8 @@ function appleReauthenticatePopup() {
var accessToken = credential.accessToken;
var idToken = credential.idToken;

// ...
// IdP data available in result.additionalUserInfo.profile.
// ...
})
.catch((error) => {
// Handle Errors here.
Expand Down
4 changes: 4 additions & 0 deletions auth/facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ function facebookSignInPopup(provider) {

// The signed-in user info.
var user = result.user;
// IdP data available in result.additionalUserInfo.profile.
// ...

// This gives you a Facebook Access Token. You can use it to access the Facebook API.
var accessToken = credential.accessToken;
Expand Down Expand Up @@ -66,6 +68,8 @@ function facebookSignInRedirectResult() {
}
// The signed-in user info.
var user = result.user;
// IdP data available in result.additionalUserInfo.profile.
// ...
}).catch((error) => {
// Handle Errors here.
var errorCode = error.code;
Expand Down
5 changes: 4 additions & 1 deletion auth/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ function githubSignInPopup(provider) {

// The signed-in user info.
var user = result.user;
// ...
// IdP data available in result.additionalUserInfo.profile.
// ...
}).catch((error) => {
// Handle Errors here.
var errorCode = error.code;
Expand Down Expand Up @@ -70,6 +71,8 @@ function githubSignInRedirectResult() {

// The signed-in user info.
var user = result.user;
// IdP data available in result.additionalUserInfo.profile.
// ...
}).catch((error) => {
// Handle Errors here.
var errorCode = error.code;
Expand Down
5 changes: 4 additions & 1 deletion auth/google-signin.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function googleSignInPopup(provider) {
var token = credential.accessToken;
// The signed-in user info.
var user = result.user;
// ...
// IdP data available in result.additionalUserInfo.profile.
// ...
}).catch((error) => {
// Handle Errors here.
var errorCode = error.code;
Expand Down Expand Up @@ -63,6 +64,8 @@ function googleSignInRedirectResult() {
}
// The signed-in user info.
var user = result.user;
// IdP data available in result.additionalUserInfo.profile.
// ...
}).catch((error) => {
// Handle Errors here.
var errorCode = error.code;
Expand Down
5 changes: 4 additions & 1 deletion auth/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function twitterSignInPopup(provider) {

// The signed-in user info.
var user = result.user;
// ...
// IdP data available in result.additionalUserInfo.profile.
// ...
}).catch((error) => {
// Handle Errors here.
var errorCode = error.code;
Expand Down Expand Up @@ -64,6 +65,8 @@ function twitterSignInRedirectResult() {

// The signed-in user info.
var user = result.user;
// IdP data available in result.additionalUserInfo.profile.
// ...
}).catch((error) => {
// Handle Errors here.
var errorCode = error.code;
Expand Down
1 change: 1 addition & 0 deletions snippets/auth-next/apple/auth_apple_signin_popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ signInWithPopup(auth, provider)
const accessToken = credential.accessToken;
const idToken = credential.idToken;

// IdP data available using getAdditionalUserInfo(result)
// ...
})
.catch((error) => {
Expand Down
1 change: 1 addition & 0 deletions snippets/auth-next/facebook/auth_facebook_signin_popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ signInWithPopup(auth, provider)
const credential = FacebookAuthProvider.credentialFromResult(result);
const accessToken = credential.accessToken;

// IdP data available using getAdditionalUserInfo(result)
// ...
})
.catch((error) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ getRedirectResult(auth)
const token = credential.accessToken;

const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
const errorCode = error.code;
Expand Down
1 change: 1 addition & 0 deletions snippets/auth-next/github/auth_github_signin_popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ signInWithPopup(auth, provider)

// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ getRedirectResult(auth)

// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
const errorCode = error.code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ signInWithPopup(auth, provider)
const token = credential.accessToken;
// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ getRedirectResult(auth)

// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
const errorCode = error.code;
Expand Down
1 change: 1 addition & 0 deletions snippets/auth-next/twitter/auth_twitter_signin_popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ signInWithPopup(auth, provider)

// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ getRedirectResult(auth)

// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
const errorCode = error.code;
Expand Down