File tree 13 files changed +17
-17
lines changed
13 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 49
49
var errorCode = error . code ;
50
50
var errorMessage = error . message ;
51
51
// [START_EXCLUDE]
52
- if ( errorCode == 'auth/operation-not-allowed' ) {
52
+ if ( errorCode === 'auth/operation-not-allowed' ) {
53
53
alert ( 'You must enable Anonymous auth in the Firebase Console.' ) ;
54
54
} else {
55
55
console . error ( error ) ;
Original file line number Diff line number Diff line change 55
55
var errorCode = error . code ;
56
56
var errorMessage = error . message ;
57
57
// [START_EXCLUDE]
58
- if ( errorCode == 'auth/invalid-custom-token' ) {
58
+ if ( errorCode === 'auth/invalid-custom-token' ) {
59
59
alert ( 'The token you provided is not valid.' ) ;
60
60
} else {
61
61
console . error ( error ) ;
Original file line number Diff line number Diff line change 60
60
var errorCode = error . code ;
61
61
var errorMessage = error . message ;
62
62
// [START_EXCLUDE]
63
- if ( errorCode == 'auth/wrong-password' ) {
63
+ if ( errorCode === 'auth/wrong-password' ) {
64
64
alert ( 'Wrong password.' ) ;
65
65
} else {
66
66
console . error ( error ) ;
Original file line number Diff line number Diff line change 82
82
// The firebase.auth.AuthCredential type that was used.
83
83
var credential = error . credential ;
84
84
// [START_EXCLUDE]
85
- if ( errorCode == 'auth/account-exists-with-different-credential' ) {
85
+ if ( errorCode === 'auth/account-exists-with-different-credential' ) {
86
86
alert ( 'You have already signed up with a different auth provider for that email.' ) ;
87
87
// If you are using multiple auth providers on your app you should handle linking
88
88
// the user's accounts here.
113
113
if ( firebaseUser ) {
114
114
var providerData = firebaseUser . providerData ;
115
115
for ( var i = 0 ; i < providerData . length ; i ++ ) {
116
- if ( providerData [ i ] . providerId === 'facebook.com' &&
117
- providerData [ i ] . uid == facebookAuthResponse . userID ) {
116
+ if ( providerData [ i ] . providerId === firebase . auth . FacebookAuthProvider . PROVIDER_ID &&
117
+ providerData [ i ] . uid === facebookAuthResponse . userID ) {
118
118
// We don't need to re-auth the Firebase connection.
119
119
return true ;
120
120
}
Original file line number Diff line number Diff line change 64
64
// The firebase.auth.AuthCredential type that was used.
65
65
var credential = error . credential ;
66
66
// [START_EXCLUDE]
67
- if ( errorCode == 'auth/account-exists-with-different-credential' ) {
67
+ if ( errorCode === 'auth/account-exists-with-different-credential' ) {
68
68
alert ( 'You have already signed up with a different auth provider for that email.' ) ;
69
69
// If you are using multiple auth providers on your app you should handle linking
70
70
// the user's accounts here.
Original file line number Diff line number Diff line change 98
98
// The firebase.auth.AuthCredential type that was used.
99
99
var credential = error . credential ;
100
100
// [START_EXCLUDE]
101
- if ( errorCode == 'auth/account-exists-with-different-credential' ) {
101
+ if ( errorCode === 'auth/account-exists-with-different-credential' ) {
102
102
alert ( 'You have already signed up with a different auth provider for that email.' ) ;
103
103
// If you are using multiple auth providers on your app you should handle linking
104
104
// the user's accounts here.
Original file line number Diff line number Diff line change 64
64
// The firebase.auth.AuthCredential type that was used.
65
65
var credential = error . credential ;
66
66
// [START_EXCLUDE]
67
- if ( errorCode == 'auth/account-exists-with-different-credential' ) {
67
+ if ( errorCode === 'auth/account-exists-with-different-credential' ) {
68
68
alert ( 'You have already signed up with a different auth provider for that email.' ) ;
69
69
// If you are using multiple auth providers on your app you should handle linking
70
70
// the user's accounts here.
Original file line number Diff line number Diff line change 98
98
// The firebase.auth.AuthCredential type that was used.
99
99
var credential = error . credential ;
100
100
// [START_EXCLUDE]
101
- if ( errorCode == 'auth/account-exists-with-different-credential' ) {
101
+ if ( errorCode === 'auth/account-exists-with-different-credential' ) {
102
102
alert ( 'You have already signed up with a different auth provider for that email.' ) ;
103
103
// If you are using multiple auth providers on your app you should handle linking
104
104
// the user's accounts here.
Original file line number Diff line number Diff line change 79
79
// The firebase.auth.AuthCredential type that was used.
80
80
var credential = error . credential ;
81
81
// [START_EXCLUDE]
82
- if ( errorCode == 'auth/account-exists-with-different-credential' ) {
82
+ if ( errorCode === 'auth/account-exists-with-different-credential' ) {
83
83
alert ( 'You have already signed up with a different auth provider for that email.' ) ;
84
84
// If you are using multiple auth providers on your app you should handle linking
85
85
// the user's accounts here.
104
104
if ( firebaseUser ) {
105
105
var providerData = firebaseUser . providerData ;
106
106
for ( var i = 0 ; i < providerData . length ; i ++ ) {
107
- if ( providerData [ i ] . providerId === 'google.com' &&
108
- providerData [ i ] . uid == googleUser . getBasicProfile ( ) . getId ( ) ) {
107
+ if ( providerData [ i ] . providerId === firebase . auth . GoogleAuthProvider . PROVIDER_ID &&
108
+ providerData [ i ] . uid === googleUser . getBasicProfile ( ) . getId ( ) ) {
109
109
// We don't need to reauth the Firebase connection.
110
110
return true ;
111
111
}
Original file line number Diff line number Diff line change 64
64
// The firebase.auth.AuthCredential type that was used.
65
65
var credential = error . credential ;
66
66
// [START_EXCLUDE]
67
- if ( errorCode == 'auth/account-exists-with-different-credential' ) {
67
+ if ( errorCode === 'auth/account-exists-with-different-credential' ) {
68
68
alert ( 'You have already signed up with a different auth provider for that email.' ) ;
69
69
// If you are using multiple auth providers on your app you should handle linking
70
70
// the user's accounts here.
Original file line number Diff line number Diff line change 98
98
// The firebase.auth.AuthCredential type that was used.
99
99
var credential = error . credential ;
100
100
// [START_EXCLUDE]
101
- if ( errorCode == 'auth/account-exists-with-different-credential' ) {
101
+ if ( errorCode === 'auth/account-exists-with-different-credential' ) {
102
102
alert ( 'You have already signed up with a different auth provider for that email.' ) ;
103
103
// If you are using multiple auth providers on your app you should handle linking
104
104
// the user's accounts here.
Original file line number Diff line number Diff line change 64
64
// The firebase.auth.AuthCredential type that was used.
65
65
var credential = error . credential ;
66
66
// [START_EXCLUDE]
67
- if ( errorCode == 'auth/account-exists-with-different-credential' ) {
67
+ if ( errorCode === 'auth/account-exists-with-different-credential' ) {
68
68
alert ( 'You have already signed up with a different auth provider for that email.' ) ;
69
69
// If you are using multiple auth providers on your app you should handle linking
70
70
// the user's accounts here.
Original file line number Diff line number Diff line change 99
99
// The firebase.auth.AuthCredential type that was used.
100
100
var credential = error . credential ;
101
101
// [START_EXCLUDE]
102
- if ( errorCode == 'auth/account-exists-with-different-credential' ) {
102
+ if ( errorCode === 'auth/account-exists-with-different-credential' ) {
103
103
alert ( 'You have already signed up with a different auth provider for that email.' ) ;
104
104
// If you are using multiple auth providers on your app you should handle linking
105
105
// the user's accounts here.
You can’t perform that action at this time.
0 commit comments