Skip to content

Add getAuth() default arg to all entry points #5064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages-exp/auth-exp/index.cordova.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* just use index.ts
*/

import { FirebaseApp, _getProvider } from '@firebase/app-exp';
import { FirebaseApp, getApp, _getProvider } from '@firebase/app-exp';
import { Auth } from './src/model/public_types';
import { indexedDBLocalPersistence } from './src/platform_browser/persistence/indexed_db';

Expand All @@ -48,7 +48,7 @@ export {

import { cordovaPopupRedirectResolver } from './src/platform_cordova/popup_redirect/popup_redirect';

export function getAuth(app: FirebaseApp): Auth {
export function getAuth(app: FirebaseApp = getApp()): Auth {
const provider = _getProvider(app, 'auth-exp');

if (provider.isInitialized()) {
Expand Down
4 changes: 2 additions & 2 deletions packages-exp/auth-exp/index.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import * as fetchImpl from 'node-fetch';

import { FirebaseApp, _getProvider } from '@firebase/app-exp';
import { FirebaseApp, getApp, _getProvider } from '@firebase/app-exp';
import { Auth } from './src/model/public_types';

import { initializeAuth } from './src';
Expand All @@ -49,7 +49,7 @@ export {
ActionCodeOperation
} from './src/model/enum_maps';

export function getAuth(app: FirebaseApp): Auth {
export function getAuth(app: FirebaseApp = getApp()): Auth {
const provider = _getProvider(app, 'auth-exp');

if (provider.isInitialized()) {
Expand Down
4 changes: 2 additions & 2 deletions packages-exp/auth-exp/index.rn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import { AsyncStorage } from 'react-native';

import { FirebaseApp, _getProvider } from '@firebase/app-exp';
import { FirebaseApp, getApp, _getProvider } from '@firebase/app-exp';
import { Auth } from './src/model/public_types';

import { initializeAuth } from './src';
Expand All @@ -39,7 +39,7 @@ export const reactNativeLocalPersistence = getReactNativePersistence(
AsyncStorage
);

export function getAuth(app: FirebaseApp): Auth {
export function getAuth(app: FirebaseApp = getApp()): Auth {
const provider = _getProvider(app, 'auth-exp');

if (provider.isInitialized()) {
Expand Down
4 changes: 2 additions & 2 deletions packages-exp/auth-exp/index.webworker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { _getProvider, FirebaseApp } from '@firebase/app-exp';
import { _getProvider, FirebaseApp, getApp } from '@firebase/app-exp';
import { Auth } from './src/model/public_types';

import { AuthImpl } from './src/core/auth/auth_impl';
Expand All @@ -34,7 +34,7 @@ export { indexedDBLocalPersistence } from './src/platform_browser/persistence/in

registerAuth(ClientPlatform.WORKER);

export function getAuth(app: FirebaseApp): Auth {
export function getAuth(app: FirebaseApp = getApp()): Auth {
// Unlike the other environments, we need to explicitly check if indexedDb is
// available. That means doing the whole rigamarole
const auth = _getProvider(
Expand Down