Skip to content

Commit 35b0572

Browse files
committed
format file
1 parent 77011c9 commit 35b0572

File tree

1 file changed

+79
-80
lines changed

1 file changed

+79
-80
lines changed

packages/auth/src/exports_auth.js

Lines changed: 79 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -616,98 +616,97 @@ fireauth.exportlib.exportFunction(
616616
fireauth.ActionCodeURL.parseLink, [fireauth.args.string('link')]);
617617

618618

619-
(function () {
620-
if (typeof firebase === 'undefined' || !firebase.INTERNAL ||
621-
!firebase.INTERNAL.registerComponent) {
622-
throw new Error('Cannot find the firebase namespace; be sure to include ' +
619+
(function() {
620+
if (typeof firebase === 'undefined' || !firebase.INTERNAL ||
621+
!firebase.INTERNAL.registerComponent) {
622+
throw new Error('Cannot find the firebase namespace; be sure to include ' +
623623
'firebase-app.js before this library.');
624-
} else {
625-
var namespace = {
626-
// Exports firebase.auth.ActionCodeInfo.Operation.
627-
'ActionCodeInfo': {
628-
'Operation': {
629-
'EMAIL_SIGNIN': fireauth.ActionCodeInfo.Operation.EMAIL_SIGNIN,
630-
'PASSWORD_RESET': fireauth.ActionCodeInfo.Operation.PASSWORD_RESET,
631-
'RECOVER_EMAIL': fireauth.ActionCodeInfo.Operation.RECOVER_EMAIL,
632-
'VERIFY_EMAIL': fireauth.ActionCodeInfo.Operation.VERIFY_EMAIL
633-
}
634-
},
635-
'Auth': fireauth.Auth,
636-
'AuthCredential': fireauth.AuthCredential,
637-
'Error': fireauth.AuthError
638-
};
639-
fireauth.exportlib.exportFunction(namespace,
624+
} else {
625+
var namespace = {
626+
// Exports firebase.auth.ActionCodeInfo.Operation.
627+
'ActionCodeInfo': {
628+
'Operation': {
629+
'EMAIL_SIGNIN': fireauth.ActionCodeInfo.Operation.EMAIL_SIGNIN,
630+
'PASSWORD_RESET': fireauth.ActionCodeInfo.Operation.PASSWORD_RESET,
631+
'RECOVER_EMAIL': fireauth.ActionCodeInfo.Operation.RECOVER_EMAIL,
632+
'VERIFY_EMAIL': fireauth.ActionCodeInfo.Operation.VERIFY_EMAIL
633+
}
634+
},
635+
'Auth': fireauth.Auth,
636+
'AuthCredential': fireauth.AuthCredential,
637+
'Error': fireauth.AuthError
638+
};
639+
fireauth.exportlib.exportFunction(namespace,
640640
'EmailAuthProvider', fireauth.EmailAuthProvider, []);
641-
fireauth.exportlib.exportFunction(namespace,
641+
fireauth.exportlib.exportFunction(namespace,
642642
'FacebookAuthProvider', fireauth.FacebookAuthProvider, []);
643-
fireauth.exportlib.exportFunction(namespace,
643+
fireauth.exportlib.exportFunction(namespace,
644644
'GithubAuthProvider', fireauth.GithubAuthProvider, []);
645-
fireauth.exportlib.exportFunction(namespace,
645+
fireauth.exportlib.exportFunction(namespace,
646646
'GoogleAuthProvider', fireauth.GoogleAuthProvider, []);
647-
fireauth.exportlib.exportFunction(namespace,
647+
fireauth.exportlib.exportFunction(namespace,
648648
'TwitterAuthProvider', fireauth.TwitterAuthProvider, []);
649-
fireauth.exportlib.exportFunction(namespace,
649+
fireauth.exportlib.exportFunction(namespace,
650650
'OAuthProvider', fireauth.OAuthProvider, [
651-
fireauth.args.string('providerId')
651+
fireauth.args.string('providerId')
652652
]);
653-
fireauth.exportlib.exportFunction(namespace,
653+
fireauth.exportlib.exportFunction(namespace,
654654
'SAMLAuthProvider', fireauth.SAMLAuthProvider, [
655-
fireauth.args.string('providerId')
655+
fireauth.args.string('providerId')
656656
]);
657-
fireauth.exportlib.exportFunction(namespace,
657+
fireauth.exportlib.exportFunction(namespace,
658658
'PhoneAuthProvider', fireauth.PhoneAuthProvider, [
659-
fireauth.args.firebaseAuth(true)
659+
fireauth.args.firebaseAuth(true)
660660
]);
661-
fireauth.exportlib.exportFunction(namespace,
661+
fireauth.exportlib.exportFunction(namespace,
662662
'RecaptchaVerifier', fireauth.RecaptchaVerifier, [
663-
fireauth.args.or(
664-
fireauth.args.string(),
665-
fireauth.args.element(),
666-
'recaptchaContainer'),
667-
fireauth.args.object('recaptchaParameters', true),
668-
fireauth.args.firebaseApp(true)
663+
fireauth.args.or(
664+
fireauth.args.string(),
665+
fireauth.args.element(),
666+
'recaptchaContainer'),
667+
fireauth.args.object('recaptchaParameters', true),
668+
fireauth.args.firebaseApp(true)
669669
]);
670-
fireauth.exportlib.exportFunction(namespace,
670+
fireauth.exportlib.exportFunction(namespace,
671671
'ActionCodeURL', fireauth.ActionCodeURL, []);
672-
673-
// Create components to register
674-
const authComponent = {
675-
'name': fireauth.exportlib.AUTH_TYPE,
676-
'instanceFactory': function (container) {
677-
var app = container['getProvider']('app')['getImmediate']();
678-
return new fireauth.Auth(app);
679-
},
680-
'multipleInstances': false,
681-
'serviceProps': namespace,
682-
'instantiationMode': 'LAZY',
683-
'type': 'PUBLIC'
684-
}
685-
686-
const authInteropComponent = {
687-
'name': 'auth-internal',
688-
'instanceFactory': function (container) {
689-
var auth = container['getProvider'](fireauth.exportlib.AUTH_TYPE)['getImmediate']();
690-
return {
691-
'getUid': goog.bind(auth.getUid, auth),
692-
'getToken': goog.bind(auth.getIdTokenInternal, auth),
693-
'addAuthTokenListener':
694-
goog.bind(auth.addAuthTokenListenerInternal, auth),
695-
'removeAuthTokenListener':
696-
goog.bind(auth.removeAuthTokenListenerInternal, auth)
697-
};
698-
},
699-
'multipleInstances': false,
700-
'instantiationMode': 'LAZY',
701-
'type': 'PRIVATE'
702-
};
703-
704-
firebase.INTERNAL.registerComponent(authComponent);
705-
firebase.INTERNAL.registerComponent(authInteropComponent);
706-
707-
708-
// Expose User as firebase.User.
709-
firebase.INTERNAL.extendNamespace({
710-
'User': fireauth.AuthUser
711-
});
712-
}
713-
})();
672+
673+
// Create auth components to register with firebase
674+
const authComponent = { // provides Auth public APIs
675+
'name': fireauth.exportlib.AUTH_TYPE,
676+
'instanceFactory': function(container) {
677+
var app = container['getProvider']('app')['getImmediate']();
678+
return new fireauth.Auth(app);
679+
},
680+
'multipleInstances': false,
681+
'serviceProps': namespace,
682+
'instantiationMode': 'LAZY',
683+
'type': 'PUBLIC'
684+
}
685+
686+
const authInteropComponent = { // provides Auth internal APIs
687+
'name': 'auth-internal',
688+
'instanceFactory': function(container) {
689+
var auth = container['getProvider'](fireauth.exportlib.AUTH_TYPE)['getImmediate']();
690+
return {
691+
'getUid': goog.bind(auth.getUid, auth),
692+
'getToken': goog.bind(auth.getIdTokenInternal, auth),
693+
'addAuthTokenListener':
694+
goog.bind(auth.addAuthTokenListenerInternal, auth),
695+
'removeAuthTokenListener':
696+
goog.bind(auth.removeAuthTokenListenerInternal, auth)
697+
};
698+
},
699+
'multipleInstances': false,
700+
'instantiationMode': 'LAZY',
701+
'type': 'PRIVATE'
702+
};
703+
704+
firebase.INTERNAL.registerComponent(authComponent);
705+
firebase.INTERNAL.registerComponent(authInteropComponent);
706+
707+
// Expose User as firebase.User.
708+
firebase.INTERNAL.extendNamespace({
709+
'User': fireauth.AuthUser
710+
});
711+
}
712+
})();

0 commit comments

Comments
 (0)