@@ -322,8 +322,10 @@ function onSetPersistence() {
322
322
function onSignUp ( ) {
323
323
var email = $ ( '#signup-email' ) . val ( ) ;
324
324
var password = $ ( '#signup-password' ) . val ( ) ;
325
- createUserWithEmailAndPassword ( auth , email , password )
326
- . then ( onAuthUserCredentialSuccess , onAuthError ) ;
325
+ createUserWithEmailAndPassword ( auth , email , password ) . then (
326
+ onAuthUserCredentialSuccess ,
327
+ onAuthError
328
+ ) ;
327
329
}
328
330
329
331
/**
@@ -332,8 +334,10 @@ function onSignUp() {
332
334
function onSignInWithEmailAndPassword ( ) {
333
335
var email = $ ( '#signin-email' ) . val ( ) ;
334
336
var password = $ ( '#signin-password' ) . val ( ) ;
335
- signInWithEmailAndPassword ( auth , email , password )
336
- . then ( onAuthUserCredentialSuccess , onAuthError ) ;
337
+ signInWithEmailAndPassword ( auth , email , password ) . then (
338
+ onAuthUserCredentialSuccess ,
339
+ onAuthError
340
+ ) ;
337
341
}
338
342
339
343
/**
@@ -355,10 +359,14 @@ function onSignInWithEmailLink() {
355
359
function onLinkWithEmailLink ( ) {
356
360
var email = $ ( '#link-with-email-link-email' ) . val ( ) ;
357
361
var link = $ ( '#link-with-email-link-link' ) . val ( ) || undefined ;
358
- var credential = firebase . auth . EmailAuthProvider
359
- . credentialWithLink ( email , link ) ;
360
- linkWithCredential ( activeUser ( ) , credential )
361
- . then ( onAuthUserCredentialSuccess , onAuthError ) ;
362
+ var credential = firebase . auth . EmailAuthProvider . credentialWithLink (
363
+ email ,
364
+ link
365
+ ) ;
366
+ linkWithCredential ( activeUser ( ) , credential ) . then (
367
+ onAuthUserCredentialSuccess ,
368
+ onAuthError
369
+ ) ;
362
370
}
363
371
364
372
/**
@@ -629,12 +637,11 @@ function signInOrLinkCredential(credential) {
629
637
return ;
630
638
}
631
639
632
- linkWithCredential ( activeUser ( ) , credential )
633
- . then ( function ( result ) {
634
- logAdditionalUserInfo ( result ) ;
635
- refreshUserData ( ) ;
636
- alertSuccess ( 'Provider linked!' ) ;
637
- } , onAuthError ) ;
640
+ linkWithCredential ( activeUser ( ) , credential ) . then ( function ( result ) {
641
+ logAdditionalUserInfo ( result ) ;
642
+ refreshUserData ( ) ;
643
+ alertSuccess ( 'Provider linked!' ) ;
644
+ } , onAuthError ) ;
638
645
} else {
639
646
signInWithCredential ( auth , credential ) . then (
640
647
onAuthUserCredentialSuccess ,
@@ -739,12 +746,13 @@ function onSendSignInLinkToEmailCurrentUrl() {
739
746
sendSignInLinkToEmail ( auth , email , actionCodeSettings ) . then ( function ( ) {
740
747
if ( 'localStorage' in window && window [ 'localStorage' ] !== null ) {
741
748
window . localStorage . setItem (
742
- 'emailForSignIn' ,
743
- // Save the email and the timestamp.
744
- JSON . stringify ( {
745
- email : email ,
746
- timestamp : new Date ( ) . getTime ( )
747
- } ) ) ;
749
+ 'emailForSignIn' ,
750
+ // Save the email and the timestamp.
751
+ JSON . stringify ( {
752
+ email : email ,
753
+ timestamp : new Date ( ) . getTime ( )
754
+ } )
755
+ ) ;
748
756
}
749
757
alertSuccess ( 'Email sent!' ) ;
750
758
} , onAuthError ) ;
@@ -824,9 +832,9 @@ function onLinkWithEmailAndPassword() {
824
832
var email = $ ( '#link-email' ) . val ( ) ;
825
833
var password = $ ( '#link-password' ) . val ( ) ;
826
834
linkWithCredential (
827
- activeUser ( ) ,
828
- firebase . auth . EmailAuthProvider . credential ( email , password ) )
829
- . then ( onAuthUserCredentialSuccess , onAuthError ) ;
835
+ activeUser ( ) ,
836
+ firebase . auth . EmailAuthProvider . credential ( email , password )
837
+ ) . then ( onAuthUserCredentialSuccess , onAuthError ) ;
830
838
}
831
839
832
840
/**
@@ -852,11 +860,10 @@ function onLinkWithGenericIdPCredential() {
852
860
*/
853
861
function onUnlinkProvider ( ) {
854
862
var providerId = $ ( '#unlinked-provider-id' ) . val ( ) ;
855
- unlink ( activeUser ( ) , providerId )
856
- . then ( function ( user ) {
857
- alertSuccess ( 'Provider unlinked from user.' ) ;
858
- refreshUserData ( ) ;
859
- } , onAuthError ) ;
863
+ unlink ( activeUser ( ) , providerId ) . then ( function ( user ) {
864
+ alertSuccess ( 'Provider unlinked from user.' ) ;
865
+ refreshUserData ( ) ;
866
+ } , onAuthError ) ;
860
867
}
861
868
862
869
/**
0 commit comments