Ionic Tutorial #11.5 - Login Page #7 - Implementing Firebase Authentication

Поделиться
HTML-код
  • Опубликовано: 24 дек 2024

Комментарии • 10

  • @dcosacox
    @dcosacox 3 месяца назад

    When I send a wrong email for validation it returns the message recovery email sent and not that the user is not on the list or was deleted... is that a new kind of response from firebase to hide the true response?

  • @ajechasteve9222
    @ajechasteve9222 Год назад +1

    Hello I'm having an error with importing firebase as you did at 4:46 in the video and as a result my app won't log in and has errors saying
    *cannot find module 'firebase' or its corresponding type declarations.ts(2307)*
    Please can this be resolved

    • @garaisq
      @garaisq Год назад +1

      Hi! I am having the same issue, did you find a solution?

    • @ahmedabdien3558
      @ahmedabdien3558 Год назад

      i checked the '@angular/fire/auth' doc, and this is my file...
      import { Injectable, inject } from '@angular/core';
      import { Observable } from 'rxjs';
      import { User } from 'src/app/shared/model/user/User';
      import { setPersistence, signInWithEmailAndPassword, browserLocalPersistence } from 'firebase/auth';
      import { Auth, UserCredential, sendPasswordResetEmail } from '@angular/fire/auth';
      @Injectable({
      providedIn: 'root'
      })
      export class AuthService {
      private auth: Auth = inject(Auth);
      constructor() { }
      recoverEmailPassword(email: string): Observable {
      return new Observable(observer => {
      sendPasswordResetEmail(this.auth, email).then(() => {
      observer.next();
      observer.complete();
      }).catch(error => {
      observer.error(error);
      observer.complete();
      })
      });
      }
      login(email: string, password: string): Observable {
      return new Observable(observer => {
      setPersistence(this.auth, browserLocalPersistence).then(() => {
      signInWithEmailAndPassword(this.auth, email, password)
      .then((firebaseUser: UserCredential) => {
      observer.next({ email, id: firebaseUser.user.uid });
      observer.complete();
      })
      .catch((err) => {
      observer.error(err);
      observer.complete();
      });
      });
      });
      }
      }

  • @samedyndaketcha5977
    @samedyndaketcha5977 7 месяцев назад

    hello sir, when I put an error email, the return is 'user is found'. please help me

  • @itwithpauloalves
    @itwithpauloalves  3 года назад

    Links:
    Firebase: firebase.google.com/
    Ionic Framework: ionicframework.com/
    Social:
    Github: github.com/paulorsaf
    Twitter: twitter.com/paulorsaf
    Instagram: instagram.com/paulorsaf
    Doubts? Join me on Discord:
    discord.com/invite/z92XBeHq6F

  • @sofianaaz2609
    @sofianaaz2609 2 года назад

    Hello sir I'm getting error that says: Argument of type '{email: string; Id : string} is not assignable to parameter of type 'User'
    Can you please resolve this error

    • @Natasha-jc7gp
      @Natasha-jc7gp 2 года назад

      login(email: string, password: string) : Observable {
      return new Observable(observer => {

      signInWithEmailAndPassword(this.auth, email, password)
      .then((userCredential) => {
      this.user = userCredential.user.uid;
      observer.next({email, id:this.user});
      observer.complete();
      })
      .catch((error) => {
      const errorCode = error.code;
      const errorMessage = error.message;
      observer.error(error);
      observer.complete();
      });


      })
      }