15
15
* limitations under the License.
16
16
*/
17
17
18
- import firebase from '@firebase/app' ;
18
+ import firebase from '@firebase/app-compat ' ;
19
19
import { _FirebaseNamespace } from '@firebase/app-types/private' ;
20
20
import * as impl from '@firebase/auth-exp/internal' ;
21
21
import * as externs from '@firebase/auth-types-exp' ;
@@ -28,20 +28,22 @@ import {
28
28
import { version } from './package.json' ;
29
29
import { Auth } from './src/auth' ;
30
30
import { Persistence } from './src/persistence' ;
31
+ import { _getClientPlatform } from './src/platform' ;
31
32
import { RecaptchaVerifier } from './src/recaptcha_verifier' ;
32
33
33
34
const AUTH_TYPE = 'auth' ;
34
35
35
36
// Create auth components to register with firebase.
36
37
// Provides Auth public APIs.
37
- function registerAuth ( instance : _FirebaseNamespace ) : void {
38
+ function registerAuthCompat ( instance : _FirebaseNamespace ) : void {
38
39
instance . INTERNAL . registerComponent (
39
40
new Component (
40
41
AUTH_TYPE ,
41
42
container => {
42
43
// getImmediate for FirebaseApp will always succeed
43
44
const app = container . getProvider ( 'app' ) . getImmediate ( ) ;
44
- return new Auth ( app ) ;
45
+ const auth = container . getProvider ( 'auth-exp' ) . getImmediate ( ) ;
46
+ return new Auth ( app , auth as impl . AuthImpl ) ;
45
47
} ,
46
48
ComponentType . PUBLIC
47
49
)
@@ -80,4 +82,5 @@ function registerAuth(instance: _FirebaseNamespace): void {
80
82
instance . registerVersion ( 'auth' , version ) ;
81
83
}
82
84
83
- registerAuth ( firebase as _FirebaseNamespace ) ;
85
+ impl . registerAuth ( _getClientPlatform ( ) ) ;
86
+ registerAuthCompat ( firebase as _FirebaseNamespace ) ;
0 commit comments