Skip to content

Commit 87627f3

Browse files
committed
Make the api conform to specifications
1 parent 082c696 commit 87627f3

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

packages-exp/auth-compat-exp/src/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ export class Auth
9797
signOut(): Promise<void> {
9898
return this.auth.signOut();
9999
}
100-
useEmulator(url: string, disableBanner = false): void {
101-
this.auth.useEmulator(url, disableBanner);
100+
useEmulator(url: string, options?: {disableWarnings: boolean}): void {
101+
this.auth.useEmulator(url, options);
102102
}
103103
applyActionCode(code: string): Promise<void> {
104104
return impl.applyActionCode(this.auth, code);

packages-exp/auth-exp/src/core/auth/auth_impl.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ describe('core/auth/auth_impl useEmulator', () => {
554554

555555
it('logs out the warning but has no banner if disableBanner true', () => {
556556
sinon.stub(console, 'info');
557-
auth.useEmulator('http://localhost:2020', true);
557+
auth.useEmulator('http://localhost:2020', {disableWarnings: true});
558558
expect(console.info).to.have.been.calledWith(
559559
'WARNING: You are using the Auth Emulator,' +
560560
' which is intended for local testing only. Do not use with' +

packages-exp/auth-exp/src/core/auth/auth_impl.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export class AuthImpl implements Auth, _FirebaseService {
271271
this.languageCode = _getUserLanguage();
272272
}
273273

274-
useEmulator(url: string, disableBanner = false): void {
274+
useEmulator(url: string, options?: {disableWarnings: boolean}): void {
275275
_assert(this._canInitEmulator, this, AuthErrorCode.EMULATOR_CONFIG_FAILED);
276276

277277
_assert(
@@ -282,7 +282,7 @@ export class AuthImpl implements Auth, _FirebaseService {
282282

283283
this.config.emulator = { url };
284284
this.settings.appVerificationDisabledForTesting = true;
285-
emitEmulatorWarning(disableBanner);
285+
emitEmulatorWarning(!!options?.disableWarnings);
286286
}
287287

288288
async _delete(): Promise<void> {
@@ -592,8 +592,8 @@ function emitEmulatorWarning(disableBanner: boolean): void {
592592
if (typeof console !== 'undefined' && typeof console.info === 'function') {
593593
console.info(
594594
'WARNING: You are using the Auth Emulator,' +
595-
' which is intended for local testing only. Do not use with' +
596-
' production credentials.'
595+
' which is intended for local testing only. Do not use with' +
596+
' production credentials.'
597597
);
598598
}
599599
if (

packages-exp/auth-types-exp/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ export interface Auth {
318318
* @param url - The URL at which the emulator is running (eg, 'http://localhost:9099').
319319
* @param disableBanner - (Optional: default false) Disable the warning banner attached to the DOM
320320
*/
321-
useEmulator(url: string, disableBanner?: boolean): void;
321+
useEmulator(url: string, options?: {disableWarnings: boolean}): void;
322322
/**
323323
* Signs out the current user.
324324
*/

0 commit comments

Comments
 (0)