Create a user without current Logout - Firebase

Asked

Viewed 15 times

0

When I am logged in to the App and create a new user automatically the active user becomes the newly created one. Some solution with Angularfire to get around this?

collaborator.ts

  colaborador: Colaborador = new Colaborador();
  @ViewChild('form') form: NgForm;

  constructor(
    public navCtrl: NavController,
    public navParams: NavParams,
    private toastCtrl: ToastController,
    private authService: AuthService) {
  }

  addColaborador(colaborador: Colaborador){
    if (this.form.form.valid) {
         this.authService.createColaborador(colaborador)
          .then((colaborador: any) => {
            colaborador.sendEmailVerification();
            this.alertToast('Colaborador incluído com sucesso.');
          })
          .catch((error: any) => {
            if (error.code == 'auth/email-already-in-use') {
              this.alertToast('O e-mail utilizado já está em uso.');
            } else if (error.code == 'auth/invalid-email') {
              this.alertToast('O e-mail digitado não é valido.');
            } else if (error.code == 'auth/operation-not-allowed') {
              this.alertToast('Usuário não autorizado a criar contas.');
            }
          });
      }
    }
  • https://stackoverflow.com/questions/37517208/firebase-kicks-out-current-user/38013551#38013551

  • @Eduardovargas, had already seen but does not clarify. I believe that the question you put unfolds in a separate back-end of the application.

  • Paece that has 3 solutions create a secondary connection with fiirebase, do by backend with vc calling back and back calling firebase or else command firebase for a post instead of using this wrapper from them.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.