Firebase Google SignIn + Firestore w/ Angular

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

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

  • @joshkramer262
    @joshkramer262 2 года назад +16

    Would be great to have an update, as it seems like AngularFire has completely changed names of objects since this video was published.

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

      Form what I found is that the imports from '@angular/fire/firestore' presented in this demo are now in '@angular/fire/compat/firestore'. I am using @angular/cli 15.0.2 and @angular/fire 7.5.0

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

      Unfortunately, Jeff/Fireship doesn't seem too keen on Angular lately,
      so I highly doubt a follow-up video will come
      fingers crossed though

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

      @@ransfordarthur4418 na he’s still in love with it. He’s just playing with new tools of late, as that’s what people want to see.

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

      @@ransfordarthur4418 His tutorials/content will be whatever the hip new thing is so he can attract more customers. Unfortunately Angular doesn't do that, even if it is still a widely used language. It's crazy how much React content there is relative to Angular.

  • @jamisonr
    @jamisonr 5 лет назад +131

    I've watched a lot of videos from this channel, and while they are well produced, there is something about the presentation that I find hard to follow. I'm not sure if it's just too fast, or if I want more background information, or something else (or all of the above).

    • @shakarshahedan
      @shakarshahedan 5 лет назад +2

      Me too :(

    • @zeyadahmad4556
      @zeyadahmad4556 5 лет назад +5

      YES!! I would pretty much love more background information. I need to know how we came up with this code and why does there lines work.

    • @brianwells990
      @brianwells990 5 лет назад

      For what it's worth, I loved this video and felt it was done very well. That said, I've spent several years getting up to speed on the underlying topics, and I've still got a long ways to go.

    • @randallerasmus
      @randallerasmus 5 лет назад

      @Useful Code Recipes You need to register and watch the whole course and pay for it. Money making ..........

    • @peterveliki7918
      @peterveliki7918 4 года назад +4

      I was very frustrated too, especially at the beginning ... but with more time passing by I realized that these videos are not tutorials actually ... they are mixture between showing off and providing just a glimpse of what you can do with Angular. ... So now I watch them a lot, but with different mindset: if now I like a topic - I know I can use the video, but I'll need to research a lot of stuff aside from this ... :) ... and these videos are just a piece of the puzzle, not the whole one.
      (Which probably is the actual goal of @fireship :) ...)

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

    Very nice summary, even 3 years later!

  • @wes443
    @wes443 5 лет назад +3

    A video on Angular libraries would be cool. Explain why/when to create a library and then how to create it and how to use it in a main project. Also, maybe a video on general guidelines for the structure of an angular project. Where to put services and models, when to make something a module, etc.

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

    Amazing tutorial!

  • @DecodedFrontend
    @DecodedFrontend 4 года назад +1

    Nice tutorial! I personally find Angular + Firebase as one of the most efficient stack for prototyping!

    • @crkell3548
      @crkell3548 4 года назад

      hi is this tutorial still relevant today?

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

    as always fireship has the best tutorials

  • @NoorUddinWD
    @NoorUddinWD 5 лет назад +1

    Looking forward to more Angular and Firebase videos!

  • @oscar272731
    @oscar272731 5 лет назад +1

    I really loved the part about firestore rules, I needed that kind of tip. Awesome video.

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

    Great! Thank a lot for so useful and short tutorial. It has closed some my critical question about this topic

  • @anymeshsingh
    @anymeshsingh 5 лет назад +33

    Looking forward to Flutter related content on this channel.

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

    You got a great implementation Mate !!🔥🔥🔥

  • @JFkingW
    @JFkingW 5 лет назад +1

    I would love to see more about SEO and Angular

  • @Tiesthatbindus
    @Tiesthatbindus 5 лет назад +2

    EXCELLENT! And great context! Fast but that's why there's pause (an hour to walk/code through the 11 minute vid).
    One problem I had is I cannot add additional user parameters. I get a FirebaseError "DocumentReference.set" "invalid data" Unsupported field for anything additional I try to add. Ex. isAdmin?: Boolean. How do I need to put this in?
    Thanks!
    UPDATE: Figured it out - Needed to check for the presence of the property on the user object in updateUserData and if null, assign it before creating the data object. Ex. if (isAdmin == null) isAdmin = false;

  • @davebeazer4007
    @davebeazer4007 5 лет назад

    Excellent video. So clear and concise - thanks Jeff!

  • @alanhernandez4989
    @alanhernandez4989 4 года назад

    Gracias,nde verdad. Recién estoy comenzando en web con angular y firestore, y este vídeo me ayudo bastante.

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

    Really need the Vue and Flutter tutorials.

  • @Bill_Ahern
    @Bill_Ahern 5 лет назад

    Thanks for this. Incredibly timely as I am implementing this exact thing over the weekend.

  • @tommywebermikkelsen3491
    @tommywebermikkelsen3491 5 лет назад +7

    A Flutter version would be awesome!

  • @JuanPabloVargasRodriguez
    @JuanPabloVargasRodriguez 5 лет назад

    Really excited for any flutter videos!

  • @StephenMoreira
    @StephenMoreira 5 лет назад +4

    Love it! Angular

  • @vinektobas3706
    @vinektobas3706 4 года назад

    THANK YOU, you saved my day with this tutorial

    • @crkell3548
      @crkell3548 4 года назад

      hi is this tutorial still relevant today?

  • @HussainArslan-m6z
    @HussainArslan-m6z Год назад

    a similar video for Kotlin Jetpack Compose would be a great help

  • @patrickmullot73
    @patrickmullot73 5 лет назад +4

    Good refresh, thanks!
    Authentication and permissioning are really complex parts of any app. Firebase ecosystem facilitates a little the first approach but is really far from doing an enterprise-grade auth system. It would be really cool to have a video about more advanced features like how to handle user administration, how to set up roles and permissions securely, etc..

    • @Fireship
      @Fireship  5 лет назад +2

      Yes, that is a topic I will revisit soon. I tackled role based auth awhile ago, so maybe next time I will setup an access control list

  • @shivamummoju4820
    @shivamummoju4820 5 лет назад +5

    Would appreciate if you show the same process with react! Excellent work with angular though.. very clear and concise. Would be better if you could link through the documentation of various packages and libraries you have used. Thanks!

    • @Fireship
      @Fireship  5 лет назад

      Thanks for the feedback. They are linked in the main lesson page, it's time consuming to duplicate everything on YT.

  • @DeimosBricks
    @DeimosBricks 5 лет назад

    Another useful solution to use with Firebase Auth is a BehaviorSubject. That way you can access to your current user info by dot notation and not subscribing.

  • @alexsky7694
    @alexsky7694 4 года назад

    Great structure. Thank you! Saved me a lot of time.

  • @MrAncha3
    @MrAncha3 5 лет назад

    Flutter would be really good to start with!!

  • @joe0hill
    @joe0hill 5 лет назад +2

    How would you approach unique usernames? Maybe a video on this next?

    • @Fireship
      @Fireship  5 лет назад +4

      Added that to the revisions list +1

  • @obeydadjeffal4442
    @obeydadjeffal4442 5 лет назад

    Nice video, seeing the same with flutter would be great

  • @qwiiky
    @qwiiky 5 лет назад +1

    Awesome, I like how Jeff has to wrap things up because baba aka "Boss Baby" in the background is hungry..Lol. I think baba is calling out Daddy to console.log(' pls put my crying emoji in the first video') for fireship.io. Great first video for fireship.io and 2019. Awesome job.

    • @Fireship
      @Fireship  5 лет назад

      Haha! You have no idea how many clips I have to re-record due to crying babies. If you listen closely you should hear one in every video.

  • @mattiaesposito5525
    @mattiaesposito5525 5 лет назад +13

    please re do the video of PWA

    • @Fireship
      @Fireship  5 лет назад +8

      That could be cool, I use workbox to make Fireship.io a PWA. It's actually very easy.

    • @niclasj2871
      @niclasj2871 5 лет назад

      @@Fireship Another interesting topic is Persistent authentication for ssr websites via service worker instead of cookies, you can find it in the docs of firebase

    • @themindstorm9947
      @themindstorm9947 5 лет назад +1

      @@Fireship is workbox better than angular/pwa?

  • @SouravDuttaROCKSTAR
    @SouravDuttaROCKSTAR 5 лет назад +1

    So that's how our fireship.io works .. already signed in to stay up to date and I'm going to do the same with my own website
    Exactly what I wanted for my blog ! This video is lit 🔥👌❤️

    • @Fireship
      @Fireship  5 лет назад

      Thanks! That's why I updated the original - it's a super important topic.

    • @SouravDuttaROCKSTAR
      @SouravDuttaROCKSTAR 5 лет назад

      Thank you so much waiting for more super cool videos 😎🤘

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

    Awesome Video. I see that Jeff created entries for the user's display name and photo URL although this is something that can be handled by the authentication service, does anyone have experience in seeing that having that information in the Firestore being more useful than letting the auth service handle it?
    Edit:
    After 10 seconds of playing around with it, I saw that the benefit is that you can query this information from other users as well. If you were to only use Firebase auth, only the signed in user could view their display name, you need it in firestore to let other users query that information also. Awesome stuff as always :)

  • @rudolfklikh5779
    @rudolfklikh5779 5 лет назад

    Best video about Firebase + Angular.Like

  • @yuhabkat
    @yuhabkat 5 лет назад +6

    thanks Jeff, what about sign in with email/password..

    • @AverageMrFox
      @AverageMrFox 5 лет назад +1

      There's a method called signInWithEmailAndPassword which you can use if you just pass the email and password in as parameters. You'll need to get the email and password from a form or some other means naturally, but other than that it's straightforward enough.

  • @sabufer
    @sabufer 4 года назад

    Great content, thanks, Jeff!

  • @amodh
    @amodh 5 лет назад +8

    Create one with vue please

  • @roflmao0o
    @roflmao0o 5 лет назад +1

    My authState change triggers like 6 times everytime i navigate to a new route. Anyone else having this problem? Havn't found any solutions online yet.

  • @davidbeljan
    @davidbeljan 5 лет назад

    Love your work! 1 vote for Flutter

  • @viniciusgalvao6270
    @viniciusgalvao6270 5 лет назад

    Great tutorial with your web site! Thanks.

  • @DheerajRijhwani
    @DheerajRijhwani 5 лет назад

    Please make more videos on basics
    .

  • @GengisCetina
    @GengisCetina 5 лет назад

    I'll like too see the Flutter implementation

  • @carniattos
    @carniattos 5 лет назад

    Awesome! A good chapter to revisit might be the file upload and add some tips how to deal with EXIF orientation

  • @christiangonzalez5270
    @christiangonzalez5270 5 лет назад

    Great Lesson!

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

    How can this be done with react. Please make video. I cant figure out how to send user to firestore in react. I only can do login and that is it

  • @adelmerhej4194
    @adelmerhej4194 5 лет назад

    Amazing explanation, thanks a lot.

  • @abinthomas12914
    @abinthomas12914 4 года назад

    Whether we can do firebase Google authentication in angular electron build (specifically when it run in local host)

  • @cupidchan1763
    @cupidchan1763 4 года назад

    I like this video as it covers an important Firebase and Angular concept in authentication. But if I have a node server as my backend, how can this come along in the equation? Shall I set the same authentication in node and direct the traffic from Angular to node? How can the session maintained and passed between frontend Angular and backend Node?

  • @mahmoud-kassem
    @mahmoud-kassem 5 лет назад +1

    Thanks for the great tutorial.
    It through a permission error after applying the database rules, it were fixed after adding, read permission to allow users rule, but I'm not sure if this is secure or not.

  • @jeromestsauver
    @jeromestsauver 5 лет назад

    would love to see this same tutorial with flutter

  • @blado9059
    @blado9059 4 года назад

    that was really helpful jeff, but how could I do it with roles like admin for example?

  • @sveinsoermo9883
    @sveinsoermo9883 5 лет назад

    Great as always, updates on SendGrid and Stripe, will be very much appreciated..:-)

  • @moosegoose1282
    @moosegoose1282 4 года назад +1

    everytime a user logs in it calls the 'set' method to Firestone. doesn't that end up charging us even though nothing is being changed for returning users?

    • @ajinkyadhomne7150
      @ajinkyadhomne7150 4 года назад

      Good question. One way to stop this is to check if the user is new or not which is .additionalUserInfo.isNewUser. If isNewUser is true only then call updateUser().

  • @tiedye001
    @tiedye001 5 лет назад

    Would this be difference if you were using a state library like ngrx? Or would authentication be outside of its scope

  • @MrOnizukakira
    @MrOnizukakira 5 лет назад +4

    Pleaaase make a react version of the video .. thank you

  • @slasladuplo4
    @slasladuplo4 5 лет назад

    Can I use the email login with ionic instead of only angular with the google signin? Also, I dont get how to utilize the http requests to set up backend, it would be awesome to have an crud/auth with cloud functions.

  • @manojisaac
    @manojisaac 4 года назад

    match /{document=**} {
    allow read, write : if false;
    }
    match /users/{userId} {
    allow read, write : if request.auth.uid == userId;
    }
    Add read also if the userId matches

  • @TrendSpotlightWithAbhishek
    @TrendSpotlightWithAbhishek 5 лет назад

    Awesome video... thanks a lot.

  • @TerVentures
    @TerVentures 5 лет назад

    How do I allow only few specific people? Please help. Thanks! I was troubled by the tilde key but now this is my only problem left. I want to authorize few more people

  • @hiteshchoudhary3412
    @hiteshchoudhary3412 5 лет назад +5

    When flutter course is coming to fireship????? Please

    • @Fireship
      @Fireship  5 лет назад +3

      I don't have a timeline for a full course, but you can expect the first flutter video sometime this month :)

    • @hiteshchoudhary3412
      @hiteshchoudhary3412 5 лет назад

      This is not going to be full course???

    • @Fireship
      @Fireship  5 лет назад +1

      @@hiteshchoudhary3412 It depends on what you mean by full course... On Fireship, a full course is ~20 videos, but I also create standalone episodes like this one here.

    • @hiteshchoudhary3412
      @hiteshchoudhary3412 5 лет назад

      @@Fireship ok

  • @kudrashabani6426
    @kudrashabani6426 4 года назад

    Thank you, this will be for all platforms ? like : android and iOS....

  • @JancoBH
    @JancoBH 5 лет назад +1

    We will have an Angular Universal + Firebase Cloud Functions video?

    • @Fireship
      @Fireship  5 лет назад +3

      Yes, that is a topic on the list.

    • @JancoBH
      @JancoBH 5 лет назад

      @@Fireship 😍😍😍😍

  • @bustamantedev
    @bustamantedev 5 лет назад

    why are we making the user$ observable equal to afAuth.authState instead of afAuth.user , what is the difference? thanks in advance

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

    Does anyone have the code for this project with the latest version of Angular on their GH? My program will compile with no errors, however when I open up local host, nothing is generated.

  • @kastoras1995
    @kastoras1995 5 лет назад

    Thanks for the tutorials,i would like to ask you a question.Lets say a user register in my app when he is offline ,how can i store the data locally and when he is offline sync them to firebase.The logicis quite simple but making it work is what concerns me.Thanks in advanced.

  • @hbkstudio9085
    @hbkstudio9085 5 лет назад

    Is this tutorial in complete or from where that login with google button came from under BASE

  • @arronmccrory
    @arronmccrory 5 лет назад

    Thanks I hoping you would make this video! Can you make a similar video that explains how to do this in a NativeScript/Angular app?

  • @junaid.hassan
    @junaid.hassan 5 лет назад

    Stripes connect, real-time maps ionic, flutter and also native script :D

  • @duncan-dean
    @duncan-dean 5 лет назад

    Maybe some unit testing in Angular for services using @angular/firebase? This seems to get tricky with some observables and Firebase specific things.

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

    Unfortunately does not work with Safari browsers -they block popups and firebase returns: firebase: Error (auth/popup-blocked)

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

    Please make the flutter version of firebase auth stream listening. Very expecting. Thank you.

  • @elmotareal
    @elmotareal 5 лет назад

    at the end of the video there was a reference to request.auth.uid, im just wondering how did that pass?

  • @dragos-andreiilies526
    @dragos-andreiilies526 4 года назад

    I don't understand the rules. How do they know I am referring to the User ID from my app? I don't understand how it checks if I am on the right account.

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

    What font is that on your vscode?

  • @usman710
    @usman710 4 месяца назад

    Chatgpt did it for me in 60 seconds

  • @techstacker5361
    @techstacker5361 5 лет назад +2

    Damn, Firebase looks so slick. Would love to see how to do this with React. Great video! 👍

  • @TristanGreenidge
    @TristanGreenidge 4 года назад

    What if I'd like to save users to the realtime database instead?

  • @mateja176
    @mateja176 5 лет назад +2

    I'd love to see more use of RxFire in react and others

    • @Fireship
      @Fireship  5 лет назад

      That would be cool. I contribute to RxFire and know the library very well. Vue has VueFire, but RxFire would probably be the best bet for react if starting today.

  • @marcusgallegos8384
    @marcusgallegos8384 5 лет назад

    Do this with Vue! FireVue all the things!

  • @Trevor.Morrice
    @Trevor.Morrice 3 года назад +1

    broken with new angular :(

  • @slasladuplo4
    @slasladuplo4 5 лет назад

    ObjectUnsubscribedErrorImpl {message: "object unsubscribed", name: "ObjectUnsubscribedError"} -- When I log in and logout, then log in again, this error pops up in the console, how to fix that? Is it dangerous?

  • @themindstorm9947
    @themindstorm9947 5 лет назад

    How do I use async variables in typescript?
    constructor(public auth: AuthService) {
    console.log(auth.user)
    }
    returns something else

    • @Fireship
      @Fireship  5 лет назад

      You need to subscribe to the observable, then provide a callback, like this: auth.user.subscribe(console.log)

  • @rathileshc
    @rathileshc 5 лет назад +3

    Please upload Flutter related videos :)

  • @samopper
    @samopper 5 лет назад

    I had a typo in the template html saying this.users$ instead of this.user$ and it took me so long to figure out why nothing was happening when i logged in :(

  • @unity_with_timoteo
    @unity_with_timoteo 4 года назад +1

    Having problems with auth?
    use this:
    import app from 'firebase'
    import 'firebase/auth' and
    new app.auth.GoogleAuthProvider()

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

      Lol yeah I had this problem. The solution was to add a "/compat" to my import statements. E.g.
      import firebase from 'firebase/compat/app';

  • @collinslagat3458
    @collinslagat3458 5 лет назад

    Do one with Vue.

  • @jafar1607
    @jafar1607 5 лет назад

    this way of checking the user$ will trigger the observable every time anybody subscribes to it. Lets assume I have a route with some data fetching to do after checking the route guard. At this time, problem is each time guard run, the whole observable is running again. it might cause a slight delay for the routed components to kick start. (checks auth guard then switchmap etc)
    What I have is a behavior subject which holds the current state (default 'null'). Each component or router guard checks that value. So there is no reinitialize or re running of the observable. Emit a new value only if auth state changed. This way there will not many subscription to the user$ observable.

  • @erickbrenessolano6311
    @erickbrenessolano6311 4 года назад

    This implementation executes constant requests to firebase. is there any wait to avoid this?

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

      You could also add NgRx for state management and it would handle this for you by storing up the info you're requesting from Firebase

  • @giacomodelillo1719
    @giacomodelillo1719 4 года назад

    can you do it whit js please?

  • @maiconm
    @maiconm 5 лет назад

    should the user.model.ts be user.interface.ts?

    • @Fireship
      @Fireship  5 лет назад

      It's up to you. I prefer model, but it doesn't matter.

    • @Bill_Ahern
      @Bill_Ahern 5 лет назад

      it IS up to you, but that's not the convention. The Interface is your model type, as you could just as easily use a Class to define your model, but they would both still be models (ie, the shape of your data object).

  • @saisreenivas2227
    @saisreenivas2227 5 лет назад +1

    Thank you

    • @Fireship
      @Fireship  5 лет назад +1

      Thanks for watching

  • @TheRomane71193
    @TheRomane71193 5 лет назад +1

    React video would be awesome

  • @BNakato
    @BNakato 5 лет назад

    Flutter would be helpful.

  • @c7ndk
    @c7ndk 5 лет назад

    Other than me who hears screaming in the backgound @ 2:14 ?🤔

  • @marcusgallegos8384
    @marcusgallegos8384 5 лет назад

    Has anyone figured out how to make this work for the Facebook provider. I tried following the same model as the google provider setup but it's not working. Ideas? Also anyone got good resources for understanding the angularfire library? The docs aren't very clear...
    async facebookSignin() {
    const provider = new auth.FacebookAuthProvider();
    const credential = await this.afAuth.auth.signInWithPopup(provider);
    return this.updateUserData(credential.user);
    }

  • @ikezedev
    @ikezedev 5 лет назад +1

    Just Jeff..... 🎩

  • @RuwanAtapattu
    @RuwanAtapattu 4 года назад

    Thank You.. !

  • @himesh_89
    @himesh_89 5 лет назад

    use case of web application and its architect on firebase, complexity level - Medium

  • @Flipkurama
    @Flipkurama 5 лет назад

    I think these rules aren't correct. I did the same thing and I get an error!