Ionic phone authentication with firebase

Hello dear ionic developer I have a little problem and I ask for your help. I develop an application and I add an authentication module with firebase phone number. But I would like to add a code at the level of app.compoment.ts so that the user only has to authenticate once. so each time he is redirected to the home page.

Thank you for your possible answer


  templateUrl: 'app.component.html'
export class AppComponent {

  @ViewChild(Nav) private nav: Nav;

  public rootPage: any = 'SignInPage'; 

  constructor(public config: Config,
              public platform: Platform,
              private authService: AuthService,
              private swService: ServiceWorkerService,
              private logger: LoggerService) {


  private initialiseApp() {

    this.platform.ready().then(() => {'AppComponent: platform.ready()');;

    this.authService.afAuth.authState.subscribe(user => {

        if (user) {
          this.rootPage = 'TabsPage';
        } else {
          this.rootPage = 'SignInPage';
      }, () => {
        this.rootPage = 'SignInPage';



@HackingCorp, Curious how you’re implementing phone auth in an ionic app. Are you using the reCaptcha verifier?

As far as i know, that won’t work in production…
Am I mistaken?