Skip to content
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

[feat](emulators): add disableWarnings option #2750

Closed
wants to merge 1 commit into from
Closed

[feat](emulators): add disableWarnings option #2750

wants to merge 1 commit into from

Conversation

geromegrignon
Copy link

@geromegrignon geromegrignon commented Feb 2, 2021

Checklist

Description

When using the emulators tokens (https://github.com/angular/angularfire/blob/master/docs/emulators/emulators.md), it uses the useEmulator(url) firebase-js-jdk function under the hood.
But it miss the disableWarnings option is stated here : https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth/src/auth.js

Code sample

The disableWarning option can now be passed as an argument of the auth emulator token.

import { URL as DATABASE_URL } from '@angular/fire/database';
import { ORIGIN as FUNCTIONS_ORIGIN } from '@angular/fire/functions';
import { SETTINGS as FIRESTORE_SETTINGS } from '@angular/fire/firestore';

@NgModule({
  // ... Existing configuration
  providers: [
    {
      provide: DATABASE_URL,
      useValue: environment.useEmulators ? `http://localhost:9000?ns=${environment.firebase.projectId}` : undefined
    },
    { provide: FIRESTORE_SETTINGS, useValue: environment.useEmulators ? { host: 'localhost:8080', ssl: false } : {} },
    { provide: FUNCTIONS_ORIGIN, useFactory: environment.useEmulators ? 'http://localhost:5001' : undefined },
  ]
})
export class AppModule { }

Documentation

i added a 6.X.X. section of the actual auth emulator documentation. This information will have to be changed according to the future version of the package.

@KingDarBoja
Copy link
Contributor

I was looking for it since the introduction of Auth Emulator 🚀 Great job.

@geromegrignon geromegrignon mentioned this pull request Mar 2, 2021
@jamesdaniels
Copy link
Member

Addressed in 7.0.0 with the @angular/fire/compat/auth#USE_EMULATORS break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants