Firebase (Google) Authentication with Angular + Guards (source code included)

Поделиться
HTML-код
  • Опубликовано: 26 окт 2024
  • Hi, in this video we'll take a look at Authenticating with Firebase Google Sign-in provider and how to block routes for unauthenticated users with Angular Guards.
    Source Code: github.com/bra...

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

  • @lucasruiz6176
    @lucasruiz6176 5 месяцев назад

    I needed to combine the angular-firebase guards with one of my own for my application thanks to this video I was able to get it working. Thanks a lot.

  • @mauroa2826
    @mauroa2826 2 года назад +1

    I was more than 20 hours looking for this solution!!!

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

    Nothing work until find you solution, Thanks!

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

    Amazing and so fast !!! Thank you very much, I appreciate your work. 🙏

  • @AbhishekKumar-lk2ei
    @AbhishekKumar-lk2ei 2 года назад

    thanks! was very helpful in my project

  • @jurgenruegenberg2214
    @jurgenruegenberg2214 2 года назад +1

    what versions of angular and angular/fire are you using?

  • @aiyale5700
    @aiyale5700 3 года назад +2

    Hi there, why am I encountering a scenario wherein the authState is becoming null after refreshing the page.?
    I hope you could help

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

      you should create a method for autoSignIn and in that save the user details,token in local storage. See the Ux trendz channel on that playlist is there.

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

    Thanks x 100

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

    Thank you!

  • @rishabraina4406
    @rishabraina4406 3 года назад +2

    import firebase from ''firebase/app' not working

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

      have the same error, any solution?

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

      For me too. Can anyone help us

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

      maybe u don't have matching firebase - angular versions

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

      Same

    • @al3xii5
      @al3xii5 2 года назад +2

      import firebase from 'firebase/compat';
      change for...
      import firebase from 'firebase/compat/app';

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

    how is environment being used can u explain ??

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

    thank you

  • @jd-code
    @jd-code 3 года назад

    how do i create email and password?

    • @ProjectBrackets
      @ProjectBrackets  3 года назад +1

      For that you need to enable Email/Password in your Sign-in providers in firebase. Take a look at firebase docs for more info: firebase.google.com/docs/auth/web/password-auth#web-v8

    • @jd-code
      @jd-code 3 года назад

      @@ProjectBrackets Thank you very much, how can I do so as soon as I press login to go to the home page?

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

      @@jd-code It depends on how you implemented things. One way is to use onAuthStateChanged which is coming from the Auth object. Then inside you can check if the user object exists then redirect the user to home page via the router.