Vue.js Firebase Authentication - New Project Tutorial

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

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

  • @boots3372
    @boots3372 4 года назад +17

    "I'm going a little fast here". Yeah, about time!
    Frankly I'm tired of RUclips tutorials treating me like this is my first day with Vue. There is (way) more than enough of those videos, I just want the meat of it and you did a great job providing that. Keep up that pace.

  • @КлимСомов-х6с
    @КлимСомов-х6с 2 года назад

    Erick, you don't even know how it was helpful for me! Thank you very much for yur work!

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

    Thanks for this video! I'm just starting with Firebase and am writing a little app where users can log in and do some things. Logging in is the first step. I'm on Firebase v9 but I was able to adapt your code to what I need and it's working great.

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

      Hey i just saw that you did it on v9. me was trying to refactor some code and since i updated firebase to v9 im getting an error from the console "Uncaught TypeError: Cannot read properties of undefined (reading 'getProvider')". thank you, if you can help me

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

      @@germanrapchartshd4345 UGH yeah updgrading to v9 looks like a pain. I started with it and have modified all the code I've been learning from to work with 9, so far so good, but you may have to redo your whole interface if you updated to 9.

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

      ​@@tiptail hey, i just saw your message now. i chose the way to downgrate to version 8 on this weekend and prolly gonna read the docu carefully while migration to version 9, also with the interface! thank you for your advice!

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

    What a timing! I just started to implement my serverless auth with Firebase alongside with Hasura :)

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

    Why do you not have the millions of subscribers you should?? You are the best man!!
    Edit: Also, use Prettier, a VSCode extension. It sort of 'beautifies' your code and makes it look much better.
    Edit 2: That VSCode theme you use looks cool. What is it?

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

    This is perfect Erik! I think my only issue now (which you may have already or plan to cover) is how to make "Secret" available to only one user (or, a different secret to each user) Kind of how maybe a "my account" would function

  • @hariharan-wt6qk
    @hariharan-wt6qk 4 года назад +7

    Before 8.0.0
    import * as firebase from 'firebase/app'
    After 8.0.0
    import firebase from 'firebase/app'

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

      thanks, this really helped me out

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

      I spent over an hour looking at Firebase docs and couldn't figure this out. Thank you!!!!!!

    • @hariharan-wt6qk
      @hariharan-wt6qk 4 года назад

      @@danielvenn243 I too spend lot of time
      But happy it helped u✌️🎊

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

      Thanks alot for this, solved my problem with auth is not an function

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

    18:30 you will get an error with Auth... i found this explanation
    import * as firebase from 'firebase'
    console.log(firebase.auth) // Undefined
    console.log(firebase.default.auth) // Function

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

      I had the same problem, try do this instead =>
      it will still be an async function but with .then() method ==>
      pressed(){
      firebase.auth().createUserWithEmailAndPassword(this.email , this.password).then(function() {
      console.log('user:', firebase.auth().currentUser);
      })
      this.$router.push({name : 'secret'})
      ==> after the then()

    • @SagiMor23
      @SagiMor23 4 года назад +2

      plus , try use this as importing:
      import { firebase } from '@firebase/app'
      import '@firebase/auth'

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

      or in the async await way:
      async pressed(){
      try{
      const user = await firebase.auth().createUserWithEmailAndPassword(this.email , this.password)
      console.log(user);
      this.$router.push({name : 'secret'})
      }catch(err){
      console.log(err)
      }
      }

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

    This is a great walkthrough, clearly explained and found it very helpful, thanks!

  • @SagiMor23
    @SagiMor23 4 года назад +2

    You forgot to put on 18:10 the await keyword!
    const user = await .... @line 25

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

    Thanks Erik, great tutorial

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

    Thank you! You saved my butt. Keep rocking!

  • @ИльдарИсламов-я8ч
    @ИльдарИсламов-я8ч 3 года назад

    Thanks you so much!!!

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

    Thanks a lot for this course. It is great.

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

    this video is perfect erik thank you

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

    The console text is to small sir, I can't see it..

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

    31:00 Cheers Bro 🥂

  • @jospuli
    @jospuli 4 года назад +2

    Tip of the day! You can move a row (or a selected block) of code by pressing alt + up/down. You're welcome!

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

    anyone ever use vuex-persistedstate package? the snippet he uses at 37:42 is not working for me because i save user uid in vuex state which is not persisted on refresh

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

    32:28 how can i find router nuxtjs?

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

    Thanks for covering this Erik. Question: any security concerns with exposing firebase config in front-end code?

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

    Thanks, do you know how do I add signup with google to that? Im having hard times with that ...

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

    Awesome but can you please tell when I am authenticated how not to get login route

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

    is it possible t use Vue Fire here?

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

    When i go to the url by using the searchbar i get the error "The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside , or missing . Bailing hydration and performing full client-side render." and it first shows the page where it is supposed to go but a second later it redirects me to the logged in page if i do not fill the Logged in page with content it does redirect me to the page it is supposed to be. Can anyone help me with this issue? Edit: Fixed it by removing cookies i didn't have a log out button so i was logged in everytime

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

    yeah but everybody can see your firebaseConfig is that okay or secure?

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

    awesome, thanks!!!!!!!!!

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

    thank you so much for that trick of gettin user state thank you so very much was stuck in this thanks for helping

  • @selcuk2321
    @selcuk2321 4 года назад +2

    Thank you for superb video. At the end just it is taken this error "uncaught (in promise) Error: Redirected when going from "/login" to "/secret" via a navigation guard"

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

    Thanks, Erik. "firebase.auth().currentUser" being null inside the route guard was a problem for me. A simple but effective solution.

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

    thank you for this video! how can I fix the refresh issue in nuxtjs since there is no main.js file?

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

    Could you list some good extensions for Vue, like the vBase, etc

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

    thank you errik

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

    Is it possible to get this same type of thing for nuxt? I tried using firebase auth with nuxt and Every time I refresh the browser, the store resets and the user information returns to being null

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

      Yes! When I was researching the refresh problem with Vue, I saw a few examples of getting it working Nuxt. It's a lot more complicated though since you have to deal with the server side and the client side. Maybe In the future I'll create a video on that

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

      Thanks for this video btw!

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

    you've got my sub !

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

    All good except on auth state change then create app;
    if network is slow app will create lately.

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

    Hi Erik, I am trying to implement link phone number to an already logged-in account in vue.js. But I find it hard to add recaptcha provided by firebase.auth to vue as component. I think it might related to virtual dom of vue v.s. firebase.auth.Recaptcha requires a container in a real dom. So how can we mount a firebase.auth.recaptcha to our vue.js as a vue component ?

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

    hey, thanks for the video. so one exposes the firebase config in the front end, but what about google firestore connection, you can't put the config into the front end, that is definetly a security issue, how can we handle that? google functions? could you explain that topic maybe?

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

      The firebase config is definetly in the front end, and since it's in the front-end code anyone has access to it if they look at the source code or source maps. The firestore connection is done through the firebase config. When you setup firestore you can setup security that only allows authenticated users or I believe you can even whitelist certains users to see things. It's definetly worth a video in the future.

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

      Hey, thank you for your answer!
      So what if someone copy’s my firebase config Code? They would be able to connect to my Firestore app but for example I have a database which should be readable by everyone because like I store data that should be displayed in a table but is updated continuously with google functions. Than i wouldn’t need and security rules except for that no one is able to right in that database but to right everything right?
      For like User profiles data saved in the database, I get that one needs to only access the authenticated user that belongs so this special data.
      Thank you!

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

    Great video! does anybody know what VS CODE THEME he's using?

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

      yh i really wanna know as well :D

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

    Erik please help ! :
    (node:29344) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
    import Vue from 'vue'
    ^^^^^^
    SyntaxError: Cannot use import statement outside a module
    _
    even after I add "type":"module"in the package.jason ,it just :
    Error [ERR_MODULE_NOT_FOUND]: Cannot find module /
    TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".vue"

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

    Nice

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

    nice!

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

    Thank u

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

    great vid! (Y)

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

    The problem about this is that your firebase config is exposed on your frontend. If you would go to the page source and click the compiled JS of Vue, which is the app.js you can totally search the firebase Config details which is very dangerous if you have firestore or database setup.

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

    it's helpful but this video makes me sleepy ...

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

      Ha! Well at least I helped you get to sleep :)

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

    What do you think of Firebase? Also check out my new sponsor algoexperts! algoexpert.io/erik

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

      Not working :(

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

      Harish m what’s not working?

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

      @@ProgramWithErik The first link is broken. The home page is algoexperts.io/product

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

      @@nero1375 Thanks fixed!

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

    Listening to you breathe is horrible. Decent tutorial though.

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

    Thank you so much sir. Very thorough and well done!