File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function oidcSignInPopup(provider) {
17
17
signInWithPopup ( auth , provider )
18
18
. then ( ( result ) => {
19
19
// User is signed in.
20
- credential = OAuthProvider . credentialFromResult ( result ) ;
20
+ const credential = OAuthProvider . credentialFromResult ( result ) ;
21
21
// This gives you an access token for the OIDC provider. You can use it to directly interact with that provider
22
22
} ) . catch ( ( error ) => {
23
23
// Handle Errors here.
@@ -50,7 +50,7 @@ function oidcSignInRedirectResult(provider) {
50
50
getRedirectResult ( auth )
51
51
. then ( ( result ) => {
52
52
// User is signed in.
53
- credential = OAuthProvider . credentialFromResult ( result ) ;
53
+ const credential = OAuthProvider . credentialFromResult ( result ) ;
54
54
// This gives you an access token for the OIDC provider. You can use it to directly interact with that provider
55
55
} )
56
56
. catch ( ( error ) => {
@@ -69,7 +69,7 @@ function oidcSignInRedirectResult(provider) {
69
69
70
70
function oidcDirectSignIn ( provider , oidcIdToken ) {
71
71
// [START auth_oidc_direct_sign_in]
72
- const { getAuth, OAuthProvider } = require ( "firebase/auth" ) ;
72
+ const { getAuth, OAuthProvider, signInWithCredential } = require ( "firebase/auth" ) ;
73
73
74
74
const auth = getAuth ( ) ;
75
75
const credential = provider . credential ( {
Original file line number Diff line number Diff line change
1
+ // These samples are intended for Web so this import would normally be
2
+ // done in HTML however using modules here is more convenient for
3
+ // ensuring sample correctness offline.
4
+ import firebase from "firebase/app" ;
5
+ import "firebase/auth" ;
6
+
1
7
// [SNIPPET_REGISTRY disabled]
2
8
// [SNIPPETS_SEPARATION enabled]
3
9
@@ -12,7 +18,7 @@ function oidcSignInPopup(provider) {
12
18
firebase . auth ( ) . signInWithPopup ( provider )
13
19
. then ( ( result ) => {
14
20
// User is signed in.
15
- // result.credential is a firebase.auth.OAuthCredential object.
21
+ // result.credential is a firebase.auth() .OAuthCredential object.
16
22
// result.credential.providerId is equal to 'oidc.myProvider'.
17
23
// result.credential.idToken is the OIDC provider's ID token.
18
24
} )
@@ -36,7 +42,7 @@ function oidcSignInRedirectResult(provider) {
36
42
firebase . auth ( ) . getRedirectResult ( )
37
43
. then ( ( result ) => {
38
44
// User is signed in.
39
- // result.credential is a firebase.auth.OAuthCredential object.
45
+ // result.credential is a firebase.auth() .OAuthCredential object.
40
46
// result.credential.providerId is equal to 'oidc.myProvider'.
41
47
// result.credential.idToken is the OIDC provider's ID token.
42
48
} )
Original file line number Diff line number Diff line change
1
+ // These samples are intended for Web so this import would normally be
2
+ // done in HTML however using modules here is more convenient for
3
+ // ensuring sample correctness offline.
4
+ import firebase from "firebase/app" ;
5
+ import "firebase/auth" ;
6
+
1
7
// [SNIPPET_REGISTRY disabled]
2
8
// [SNIPPETS_SEPARATION enabled]
3
9
You can’t perform that action at this time.
0 commit comments