File tree 4 files changed +20
-12
lines changed
4 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,14 @@ export class Auth
170
170
}
171
171
return convertCredential ( this . _delegate , Promise . resolve ( credential ) ) ;
172
172
}
173
+
174
+ // This function should only be called by frameworks (e.g. FirebaseUI-web) to log their usage.
175
+ // It is not intended for direct use by developer apps. NO jsdoc here to intentionally leave it
176
+ // out of autogenerated documentation pages to reduce accidental misuse.
177
+ addFrameworkForLogging ( framework : string ) : void {
178
+ exp . addFrameworkForLogging ( this . _delegate , framework ) ;
179
+ }
180
+
173
181
onAuthStateChanged (
174
182
nextOrObserver : Observer < unknown > | ( ( a : compat . User | null ) => unknown ) ,
175
183
errorFn ?: ( error : compat . Error ) => unknown ,
Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
18
+ import { _castAuth } from '../src/core/auth/auth_impl' ;
19
+ import { Auth } from '../src/model/public_types' ;
20
+
18
21
/**
19
22
* This interface is intended only for use by @firebase/auth-compat-exp, do not use directly
20
23
*/
@@ -45,3 +48,10 @@ export { _getRedirectResult } from '../src/platform_browser/strategies/redirect'
45
48
export { cordovaPopupRedirectResolver } from '../src/platform_cordova/popup_redirect/popup_redirect' ;
46
49
export { FetchProvider } from '../src/core/util/fetch_provider' ;
47
50
export { SAMLAuthCredential } from '../src/core/credentials/saml' ;
51
+
52
+ // This function should only be called by frameworks (e.g. FirebaseUI-web) to log their usage.
53
+ // It is not intended for direct use by developer apps. NO jsdoc here to intentionally leave it out
54
+ // of autogenerated documentation pages to reduce accidental misuse.
55
+ export function addFrameworkForLogging ( auth : Auth , framework : string ) : void {
56
+ _castAuth ( auth ) . _logFramework ( framework ) ;
57
+ }
Original file line number Diff line number Diff line change @@ -562,7 +562,7 @@ export class AuthImpl implements AuthInternal, _FirebaseService {
562
562
private frameworks : string [ ] = [ ] ;
563
563
private clientVersion : string ;
564
564
_logFramework ( framework : string ) : void {
565
- if ( this . frameworks . includes ( framework ) ) {
565
+ if ( ! framework || this . frameworks . includes ( framework ) ) {
566
566
return ;
567
567
}
568
568
this . frameworks . push ( framework ) ;
Original file line number Diff line number Diff line change @@ -31,18 +31,8 @@ export const enum ClientPlatform {
31
31
WORKER = 'Worker'
32
32
}
33
33
34
- const enum ClientFramework {
35
- // No other framework used.
36
- DEFAULT = 'FirebaseCore-web' ,
37
- // Firebase Auth used with FirebaseUI-web.
38
- // TODO: Pass this in when used in conjunction with FirebaseUI
39
- FIREBASEUI = 'FirebaseUI-web'
40
- }
41
-
42
34
/*
43
35
* Determine the SDK version string
44
- *
45
- * TODO: This should be set on the Auth object during initialization
46
36
*/
47
37
export function _getClientVersion (
48
38
clientPlatform : ClientPlatform ,
@@ -65,6 +55,6 @@ export function _getClientVersion(
65
55
}
66
56
const reportedFrameworks = frameworks . length
67
57
? frameworks . join ( ',' )
68
- : ClientFramework . DEFAULT ;
58
+ : 'FirebaseCore-web' ; /* default value if no other framework is used */
69
59
return `${ reportedPlatform } /${ ClientImplementation . CORE } /${ SDK_VERSION } /${ reportedFrameworks } ` ;
70
60
}
You can’t perform that action at this time.
0 commit comments