@@ -36,11 +36,7 @@ function getProviders() {
3636 // [END auth_get_providers]
3737}
3838
39- function simpleLink ( ) {
40- // This is just a dummy variable for sample purposes, the other
41- // snippets demonstrate how to get a real credential.
42- var credential = new firebase . auth . AuthCredential ( ) ;
43-
39+ function simpleLink ( credential ) {
4440 // [START auth_simple_link]
4541 auth . currentUser . linkWithCredential ( credential )
4642 . then ( function ( usercred ) {
@@ -52,11 +48,7 @@ function simpleLink() {
5248 // [END auth_simple_link]
5349}
5450
55- function anonymousLink ( ) {
56- // This is just a dummy variable for sample purposes, the other
57- // snippets demonstrate how to get a real credential.
58- var credential = new firebase . auth . AuthCredential ( ) ;
59-
51+ function anonymousLink ( credential ) {
6052 // [START auth_anonymous_link]
6153 auth . currentUser . linkWithCredential ( credential )
6254 . then ( function ( usercred ) {
@@ -108,11 +100,7 @@ function linkWithRedirect() {
108100 // [END auth_get_redirect_result]
109101}
110102
111- function mergeAccounts ( ) {
112- // This is just a dummy variable for sample purposes, the other
113- // snippets demonstrate how to get a real credential.
114- var newCredential = new firebase . auth . AuthCredential ( ) ;
115-
103+ function mergeAccounts ( newCredential ) {
116104 // [START auth_merge_accounts]
117105 // The implementation of how you store your user data depends on your application
118106 var repo = new MyUserDataRepo ( ) ;
@@ -150,7 +138,6 @@ function mergeAccounts() {
150138 // If there are errors we want to undo the data merge/deletion
151139 console . log ( "Sign In Error" , error ) ;
152140 repo . set ( prevUser , prevUserData ) ;
153- repo . set ( currentUser , currentUserData ) ;
154141 } ) ;
155142 // [END auth_merge_accounts]
156143}
@@ -164,7 +151,7 @@ function makeEmailCredential() {
164151 // [END auth_make_email_credential]
165152}
166153
167- function unlink ( ) {
154+ function unlink ( providerId ) {
168155 var user = auth . currentUser ;
169156
170157 // [START auth_unlink_provider]
0 commit comments