@@ -51,7 +51,7 @@ goog.require('goog.object');
51
51
52
52
53
53
/**
54
- * Creates the Firebase Auth corresponding for the app provided.
54
+ * Creates the Firebase Auth corresponding for the App provided.
55
55
*
56
56
* @param {!firebase.app.App } app The corresponding Firebase App.
57
57
* @constructor
@@ -62,10 +62,10 @@ goog.require('goog.object');
62
62
fireauth . Auth = function ( app ) {
63
63
/** @private {boolean} Whether this instance is deleted. */
64
64
this . deleted_ = false ;
65
- /** Auth's corresponding app . */
65
+ /** Auth's corresponding App . */
66
66
fireauth . object . setReadonlyProperty ( this , 'app' , app ) ;
67
- // Initialize rpc handler.
68
- // Api key is required for web client rpc calls.
67
+ // Initialize RPC handler.
68
+ // API key is required for web client RPC calls.
69
69
if ( this . app_ ( ) . options && this . app_ ( ) . options [ 'apiKey' ] ) {
70
70
var clientFullVersion = firebase . SDK_VERSION ?
71
71
fireauth . util . getClientVersion (
@@ -159,7 +159,7 @@ fireauth.Auth = function(app) {
159
159
this . INTERNAL [ 'delete' ] = goog . bind ( this . delete , this ) ;
160
160
this . INTERNAL [ 'logFramework' ] = goog . bind ( this . logFramework , this ) ;
161
161
/**
162
- * @private {number} The number of Firebase services subscribed to auth
162
+ * @private {number} The number of Firebase services subscribed to Auth
163
163
* changes.
164
164
*/
165
165
this . firebaseServices_ = 0 ;
@@ -206,7 +206,7 @@ goog.inherits(fireauth.Auth.FrameworkChangeEvent, goog.events.Event);
206
206
207
207
/**
208
208
* Changes the Auth state persistence to the specified one.
209
- * @param {!fireauth.authStorage.Persistence } persistence The auth state
209
+ * @param {!fireauth.authStorage.Persistence } persistence The Auth state
210
210
* persistence mechanism.
211
211
* @return {!goog.Promise<void> }
212
212
*/
@@ -349,7 +349,7 @@ fireauth.Auth.prototype.notifyLanguageCodeListeners_ = function() {
349
349
*/
350
350
fireauth . Auth . prototype . toJSON = function ( ) {
351
351
// Return the plain object representation in case JSON.stringify is called on
352
- // an auth instance.
352
+ // an Auth instance.
353
353
return {
354
354
'apiKey' : this . app_ ( ) . options [ 'apiKey' ] ,
355
355
'authDomain' : this . app_ ( ) . options [ 'authDomain' ] ,
@@ -365,8 +365,8 @@ fireauth.Auth.prototype.toJSON = function() {
365
365
* @private
366
366
*/
367
367
fireauth . Auth . prototype . getAuthEventManager_ = function ( ) {
368
- // Either return cached auth event manager promise provider if available or a
369
- // promise that rejects with missing auth domain error.
368
+ // Either return cached Auth event manager promise provider if available or a
369
+ // promise that rejects with missing Auth domain error.
370
370
return this . eventManagerProviderPromise_ ||
371
371
goog . Promise . reject (
372
372
new fireauth . AuthError ( fireauth . authenum . Error . MISSING_AUTH_DOMAIN ) ) ;
@@ -378,13 +378,13 @@ fireauth.Auth.prototype.getAuthEventManager_ = function() {
378
378
* @private
379
379
*/
380
380
fireauth . Auth . prototype . initAuthEventManager_ = function ( ) {
381
- // Initialize auth event manager on initState.
381
+ // Initialize Auth event manager on initState.
382
382
var self = this ;
383
383
var authDomain = this . app_ ( ) . options [ 'authDomain' ] ;
384
384
var apiKey = this . app_ ( ) . options [ 'apiKey' ] ;
385
385
// Make sure environment also supports popup and redirect.
386
386
if ( authDomain && fireauth . util . isPopupRedirectSupported ( ) ) {
387
- // auth domain is required for auth event manager to resolve.
387
+ // Auth domain is required for Auth event manager to resolve.
388
388
// Auth state has to be loaded first. One reason is to process link events.
389
389
this . eventManagerProviderPromise_ = this . authStateLoaded_ . then ( function ( ) {
390
390
if ( self . deleted_ ) {
@@ -427,7 +427,7 @@ fireauth.Auth.prototype.initAuthEventManager_ = function() {
427
427
428
428
/**
429
429
* @param {!fireauth.AuthEvent.Type } mode The Auth type mode.
430
- * @param {?string= } opt_eventId The event id .
430
+ * @param {?string= } opt_eventId The event ID .
431
431
* @return {boolean } Whether the auth event handler can handler the provided
432
432
* event.
433
433
* @override
@@ -442,7 +442,7 @@ fireauth.Auth.prototype.canHandleAuthEvent = function(mode, opt_eventId) {
442
442
case fireauth . AuthEvent . Type . SIGN_IN_VIA_REDIRECT :
443
443
return true ;
444
444
case fireauth . AuthEvent . Type . SIGN_IN_VIA_POPUP :
445
- // Pending sign in with popup event must match the stored popup event id .
445
+ // Pending sign in with popup event must match the stored popup event ID .
446
446
return this . popupEventId_ == opt_eventId &&
447
447
! ! this . pendingPopupResolvePromise_ ;
448
448
default :
@@ -454,16 +454,16 @@ fireauth.Auth.prototype.canHandleAuthEvent = function(mode, opt_eventId) {
454
454
/**
455
455
* Completes the pending popup operation. If error is not null, rejects with the
456
456
* error. Otherwise, it resolves with the popup redirect result.
457
- * @param {!fireauth.AuthEvent.Type } mode The auth type mode.
457
+ * @param {!fireauth.AuthEvent.Type } mode The Auth type mode.
458
458
* @param {?fireauth.AuthEventManager.Result } popupRedirectResult The result
459
459
* to resolve with when no error supplied.
460
460
* @param {?fireauth.AuthError } error When supplied, the promise will reject.
461
- * @param {?string= } opt_eventId The event id .
461
+ * @param {?string= } opt_eventId The event ID .
462
462
* @override
463
463
*/
464
464
fireauth . Auth . prototype . resolvePendingPopupEvent =
465
465
function ( mode , popupRedirectResult , error , opt_eventId ) {
466
- // Only handles popup events of type sign in and which match popup event id .
466
+ // Only handles popup events of type sign in and which match popup event ID .
467
467
if ( mode != fireauth . AuthEvent . Type . SIGN_IN_VIA_POPUP ||
468
468
this . popupEventId_ != opt_eventId ) {
469
469
return ;
@@ -492,7 +492,7 @@ fireauth.Auth.prototype.resolvePendingPopupEvent =
492
492
* Returns the handler's appropriate popup and redirect sign in operation
493
493
* finisher.
494
494
* @param {!fireauth.AuthEvent.Type } mode The Auth type mode.
495
- * @param {?string= } opt_eventId The optional event id .
495
+ * @param {?string= } opt_eventId The optional event ID .
496
496
* @return {?function(string,
497
497
* string):!goog.Promise<!fireauth.AuthEventManager.Result>}
498
498
* @override
@@ -549,7 +549,7 @@ fireauth.Auth.prototype.finishPopupAndRedirectSignIn =
549
549
var p = self . authStateLoaded_ . then ( function ( ) {
550
550
return idTokenResolver ;
551
551
} ) . then ( function ( idTokenResponse ) {
552
- // Use ID token response to sign in the auth user.
552
+ // Use ID token response to sign in the Auth user.
553
553
return self . signInWithIdTokenResponse ( idTokenResponse ) ;
554
554
} ) . then ( function ( ) {
555
555
// On sign in success, construct redirect and popup result and return a
@@ -597,7 +597,7 @@ fireauth.Auth.prototype.signInWithPopup = function(provider) {
597
597
// There could multiple sign in with popup events in different windows.
598
598
// We need to match the correct popup to the correct pending promise.
599
599
var eventId = this . generateEventId_ ( ) ;
600
- // If incapable of redirecting popup from opener, popup destination url
600
+ // If incapable of redirecting popup from opener, popup destination URL
601
601
// directly. This could also happen in a sandboxed iframe.
602
602
var oauthHelperWidgetUrl = null ;
603
603
if ( ( ! fireauth . util . runsInBackground ( ) || fireauth . util . isIframe ( ) ) &&
@@ -730,7 +730,7 @@ fireauth.Auth.prototype.getRedirectResult = function() {
730
730
731
731
/**
732
732
* Completes the headless sign in with the server response containing the STS
733
- * access and refresh tokens, and sets the auth user as current user while
733
+ * access and refresh tokens, and sets the Auth user as current user while
734
734
* setting all listeners to it and saving it to storage.
735
735
* @param {!Object<string, string> } idTokenResponse The ID token response from
736
736
* the server.
@@ -823,7 +823,7 @@ fireauth.Auth.prototype.signOut = function() {
823
823
return /** @type {!fireauth.storage.UserManager } */ (
824
824
self . userStorageManager_ ) . removeCurrentUser ( )
825
825
. then ( function ( ) {
826
- // Notify external auth listeners of this auth change event.
826
+ // Notify external Auth listeners of this Auth change event.
827
827
self . notifyAuthListeners_ ( ) ;
828
828
} ) ;
829
829
} ) ;
@@ -862,7 +862,7 @@ fireauth.Auth.prototype.initRedirectUser_ = function() {
862
862
863
863
864
864
/**
865
- * Loads the initial auth state for current application from web storage and
865
+ * Loads the initial Auth state for current application from web storage and
866
866
* initializes Auth user accordingly to reflect that state. This routine does
867
867
* not wait for any pending redirect result to be resolved.
868
868
* @return {!goog.Promise<undefined> } Promise that resolves when state is ready,
@@ -934,7 +934,7 @@ fireauth.Auth.prototype.initAuthState_ = function() {
934
934
935
935
/**
936
936
* After initial Auth state is loaded, waits for any pending redirect result,
937
- * resolves it and then adds the external auth state change listeners and
937
+ * resolves it and then adds the external Auth state change listeners and
938
938
* triggers first state of all observers.
939
939
* @return {!goog.Promise<undefined> } Promise that resolves when state is ready
940
940
* taking into account any pending redirect result.
@@ -954,7 +954,7 @@ fireauth.Auth.prototype.initAuthRedirectState_ = function() {
954
954
if ( self . deleted_ ) {
955
955
return ;
956
956
}
957
- // Between init auth state and get redirect result resolution there
957
+ // Between init Auth state and get redirect result resolution there
958
958
// could have been a sign in attempt in another window.
959
959
// Force sync and then add listener to run sync on change below.
960
960
return self . getSyncAuthUserChanges_ ( ) ;
@@ -1149,7 +1149,7 @@ fireauth.Auth.prototype.attachEventListeners_ = function(user) {
1149
1149
fireauth . UserEventType . USER_INVALIDATED ,
1150
1150
this . userInvalidatedListener_ ) ;
1151
1151
// Start proactive token refresh on new user if there is at least one
1152
- // Firebase service subscribed to auth changes.
1152
+ // Firebase service subscribed to Auth changes.
1153
1153
if ( this . firebaseServices_ > 0 ) {
1154
1154
user . startProactiveRefresh ( ) ;
1155
1155
}
@@ -1230,14 +1230,14 @@ fireauth.Auth.prototype.initUserStateObserver_ = function(observer) {
1230
1230
1231
1231
1232
1232
/**
1233
- * Adds an observer for auth state changes, we need to wrap the call as
1233
+ * Adds an observer for Auth state changes, we need to wrap the call as
1234
1234
* the args checking code needs a method defined on the prototype this way,
1235
1235
* not within the constructor, and we also have to implement the behavior
1236
1236
* that will trigger an observer right away if state is ready.
1237
1237
* @param {!firebase.Observer|function(?fireauth.AuthUser) }
1238
1238
* nextOrObserver An observer object or a function triggered on change.
1239
1239
* @param {function(!fireauth.AuthError)= } opt_error Optional A function
1240
- * triggered on auth error.
1240
+ * triggered on Auth error.
1241
1241
* @param {function()= } opt_completed Optional A function triggered when the
1242
1242
* observer is removed.
1243
1243
* @return {!function() } The unsubscribe function for the observer.
@@ -1360,7 +1360,7 @@ fireauth.Auth.prototype.getIdTokenInternal = function(opt_forceRefresh) {
1360
1360
fireauth . Auth . prototype . signInWithCustomToken = function ( token ) {
1361
1361
var self = this ;
1362
1362
// Wait for the redirect state to be determined before proceeding. If critical
1363
- // errors like web storage unsupported are detected, fail before rpc , instead
1363
+ // errors like web storage unsupported are detected, fail before RPC , instead
1364
1364
// of after.
1365
1365
return this . redirectStateIsReady_ . then ( function ( ) {
1366
1366
return self . signInWithIdTokenProvider_ (
@@ -1388,7 +1388,7 @@ fireauth.Auth.prototype.signInWithEmailAndPassword =
1388
1388
function ( email , password ) {
1389
1389
var self = this ;
1390
1390
// Wait for the redirect state to be determined before proceeding. If critical
1391
- // errors like web storage unsupported are detected, fail before rpc , instead
1391
+ // errors like web storage unsupported are detected, fail before RPC , instead
1392
1392
// of after.
1393
1393
return this . redirectStateIsReady_ . then ( function ( ) {
1394
1394
return self . signInWithIdTokenProvider_ (
@@ -1409,7 +1409,7 @@ fireauth.Auth.prototype.createUserWithEmailAndPassword =
1409
1409
function ( email , password ) {
1410
1410
var self = this ;
1411
1411
// Wait for the redirect state to be determined before proceeding. If critical
1412
- // errors like web storage unsupported are detected, fail before rpc , instead
1412
+ // errors like web storage unsupported are detected, fail before RPC , instead
1413
1413
// of after.
1414
1414
return this . redirectStateIsReady_ . then ( function ( ) {
1415
1415
return self . signInWithIdTokenProvider_ (
@@ -1446,7 +1446,7 @@ fireauth.Auth.prototype.signInAndRetrieveDataWithCredential =
1446
1446
// decide how to retrieve ID token.
1447
1447
var self = this ;
1448
1448
// Wait for the redirect state to be determined before proceeding. If critical
1449
- // errors like web storage unsupported are detected, fail before rpc , instead
1449
+ // errors like web storage unsupported are detected, fail before RPC , instead
1450
1450
// of after.
1451
1451
return this . redirectStateIsReady_ . then ( function ( ) {
1452
1452
// Return the full response object and not just the user.
@@ -1463,7 +1463,7 @@ fireauth.Auth.prototype.signInAndRetrieveDataWithCredential =
1463
1463
fireauth . Auth . prototype . signInAnonymously = function ( ) {
1464
1464
var self = this ;
1465
1465
// Wait for the redirect state to be determined before proceeding. If critical
1466
- // errors like web storage unsupported are detected, fail before rpc , instead
1466
+ // errors like web storage unsupported are detected, fail before RPC , instead
1467
1467
// of after.
1468
1468
return this . redirectStateIsReady_ . then ( function ( ) {
1469
1469
var user = self . currentUser_ ( ) ;
@@ -1494,7 +1494,7 @@ fireauth.Auth.prototype.signInAnonymously = function() {
1494
1494
1495
1495
1496
1496
/**
1497
- * @return {string } The key used for storing auth state.
1497
+ * @return {string } The key used for storing Auth state.
1498
1498
*/
1499
1499
fireauth . Auth . prototype . getStorageKey = function ( ) {
1500
1500
return fireauth . util . createStorageKey (
@@ -1514,7 +1514,7 @@ fireauth.Auth.prototype.app_ = function() {
1514
1514
1515
1515
1516
1516
/**
1517
- * @return {!fireauth.RpcHandler } The rpc handler.
1517
+ * @return {!fireauth.RpcHandler } The RPC handler.
1518
1518
*/
1519
1519
fireauth . Auth . prototype . getRpcHandler = function ( ) {
1520
1520
return this . rpcHandler_ ;
0 commit comments