EASY Vue 3 Authentication with Firebase ~ Login Form Vue JS Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024
  • Learn how to easily authenticate your vue js application with firebase by creating a simple but effective login / register application with protected routes. Firebase's easy to use framework makes authentication a breeze in Vue 3 using the composition API.
    Source code: github.com/Tyl...
    // Support me on Ko-Fi
    ko-fi.com/tyle...
    // FOLLOW ME ON TWITTER
    / tyler_potts_
    // BECOME A MEMBER
    www.youtube.co...
    // MY GEAR FOR CODING AND TH-cam
    Blue Yeti Microphone: amzn.to/3jr3l7T
    Microphone Stand: amzn.to/35B9LMN
    Chair: amzn.to/3dWds3F
    Thunderbolt Dock: amzn.to/3osBF6u
    Monitor: amzn.to/37I8KoR
    All of these products I own and have tested!
    // INTERESTED IN GAME DEV?
    Game development channel: / muddywolf
    // CHECK OUT MY GAME
    play.google.co...
    // DO THESE SIMPLE STEPS
    LIKE, SUBSCRIBE & SHARE

ความคิดเห็น • 102

  • @jasbirkhalif1314
    @jasbirkhalif1314 2 ปีที่แล้ว +2

    a unique way of teaching. haven't enjoyed tutorials for long but this was special

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว +1

      Awesome, thank you!

  • @FirstLast-gk6lg
    @FirstLast-gk6lg 3 ปีที่แล้ว +3

    Absolutely love your tutorials some of the best on TH-cam. I love how quickly you go through it, always better to slow down a tutorial than speed it up.

    • @TylerPotts
      @TylerPotts  3 ปีที่แล้ว

      Awesome, thank you!

  • @mvpopuk
    @mvpopuk 3 ปีที่แล้ว +3

    I love your sense of humour as well as the tutorials you’re making 🤘🏻

    • @TylerPotts
      @TylerPotts  3 ปีที่แล้ว +1

      I appreciate that!

  • @soufianemchanna6251
    @soufianemchanna6251 2 ปีที่แล้ว +1

    frankly, you are the best instructor for me

  • @heyyy4987
    @heyyy4987 3 ปีที่แล้ว +2

    nice. continue with vue 3 and firebase series

    • @TylerPotts
      @TylerPotts  3 ปีที่แล้ว

      More Vue x Firebase coming up!

  • @stevensnowden8940
    @stevensnowden8940 2 ปีที่แล้ว +1

    dude, am so grateful for this

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว

      Thanks for watching, Steven!

  • @angelonavarro9591
    @angelonavarro9591 3 ปีที่แล้ว +1

    Hello, I'm having trouble installing firebase, whenever I run the command npm i firebase it always gives a message saying 10 moderate severity vulnerabilities.

  • @tisanefruitrouge9512
    @tisanefruitrouge9512 3 ปีที่แล้ว +2

    Great Video! Thanks a lot mate! I love the VueJS tutorials! What do you think of Tailwind css?

  • @MuhammadAdnan2.0
    @MuhammadAdnan2.0 3 ปีที่แล้ว +1

    Well explained... Looking for more stuff Vue & Firebase ❤️

    • @TylerPotts
      @TylerPotts  3 ปีที่แล้ว +1

      Thanks, more to come!

  • @DougyVAL
    @DougyVAL 3 ปีที่แล้ว +2

    ERROR WITH REFRESHING:
    After logging in I see: "Welcome, test"
    After I refresh the same page I see: "Welcome," the "test" is gone
    I can still route to the about page and back to the home page and I am still logged in. How can I handle this refresh issue?

    • @cimon__
      @cimon__ 3 ปีที่แล้ว

      I have the same problem.

    • @DougyVAL
      @DougyVAL 3 ปีที่แล้ว +1

      @@cimon__ my solution was to store the name is LocalStorage. I would place it in storage onBeforeMount and then onMounted I would retrieve it from LocalStorage.

  • @sheljinchacko800
    @sheljinchacko800 3 ปีที่แล้ว +1

    Tyler, thank you very much for understandable and cool tutorial. Well done!

  • @josht7238
    @josht7238 2 ปีที่แล้ว +1

    thankyou so much for this video!!

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว

      Glad it was helpful!

  • @joshfoster9785
    @joshfoster9785 3 ปีที่แล้ว +1

    Thanks @Douglas Sliverman your fixed worked, For those that got no page and error below, i used onMounted rather than onBeforeMount and my app is visible im new to lifecycle hooks in vue and could do with an explanation for why i was getting the error in code
    We're sorry but vue-auth-yt doesn't work properly without JavaScript enabled. Please enable it to continue. my javascript is enabled also by doing this on the lifecycle event not before is there any security issues? thanks

    • @joshfoster9785
      @joshfoster9785 3 ปีที่แล้ว

      Quick update updating my global vue cli solved this

  • @T0mv-n4i
    @T0mv-n4i 2 ปีที่แล้ว +1

    Amazingly helpful tutorial! Thank you 🙌

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว

      Glad it was helpful!

  • @AhmadHassan-ss5un
    @AhmadHassan-ss5un 3 ปีที่แล้ว +1

    I was waiting 😁👌

  • @matildasmedman9879
    @matildasmedman9879 3 ปีที่แล้ว

    Hi! Firstly, amazing toturial! Secondly, do you know when you are adding the google authentication to this app? Super exited to see it!

  • @tr5946
    @tr5946 3 ปีที่แล้ว +5

    Hey Tyler, if you still have the source code for this project, could you post it to github? The source code link in the description does not have the complete code.

  • @PureAlbania
    @PureAlbania 3 ปีที่แล้ว +1

    Can you make a video on using Goggle and Facebook authentication with Firebase and connecting with this existing email Firebase account. Thanks.

  • @vitalmipango6618
    @vitalmipango6618 3 ปีที่แล้ว +1

    nice tutorial very helpful to me .thanks

  • @rangabharath4253
    @rangabharath4253 3 ปีที่แล้ว +2

    Awesome as always 👍😊

    • @TylerPotts
      @TylerPotts  3 ปีที่แล้ว +1

      Thank you! Cheers!

  • @TheBorninmotion
    @TheBorninmotion 3 ปีที่แล้ว +1

    more vue firebase tuts please !

  • @artemkomarov9902
    @artemkomarov9902 2 ปีที่แล้ว +1

    We need updates! a lot of changes, today ..) its not work at all, today) because of new syntax and api changes ) And additional question, how to show navbar if user login, for example ) v-if="user"; thank you !

  • @notfound6161
    @notfound6161 3 ปีที่แล้ว

    Another option is to add this code into index.js file on router folder...
    const routes = [
    {
    path: '/',
    name: 'Home',
    component: Home,
    meta: {
    requiresAuth: true
    //THIS ONE DO THE MAGIC
    }
    ]
    //THIS ONE
    router.beforeEach((to, from, next) => {
    if (to.matched.some(record => record.meta.requiresAuth)) {
    next({
    path: '/login',
    params: { nextUrl: to.fullPath }
    })
    } else {
    next()
    }
    //Add ur own logic is just an example
    })

  • @rafsan2744
    @rafsan2744 3 ปีที่แล้ว

    You have done it brilliantly

  • @minoscalderon7503
    @minoscalderon7503 3 ปีที่แล้ว +2

    What theme do you use and what extensions to develop faster? nice vid ty

  • @siddharthpadwal9649
    @siddharthpadwal9649 2 ปีที่แล้ว +1

    Awesome video 👍

    • @siddharthpadwal9649
      @siddharthpadwal9649 2 ปีที่แล้ว +1

      Create more videos on vue js, probably a full stack MEVN app / some big company clone!

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว +1

      Thank you 👍

  • @johannesschreurs430
    @johannesschreurs430 3 ปีที่แล้ว

    This is what creates code monkeys, you glance over so many topics that are crucial to properly understanding Vue, without going in depth to them. You start using the setup function without going into detail what it will do, same goes for onBeforeMount and ref. People following this video might get a nice basic login, authenticated by Firebase, but I don't think they will be able to understand why it works or what they made.
    There is not much learning in this video, only following along and creating something that has no real world value.
    If you want to learn Vue properly, I'd suggest going to the Vue docs and then to the Firebase docs if you are invested into using the both of them combined.
    Not to mention the fact that the code on Github is not the final code that was used in the example.

  • @anacleidesilvatorres9497
    @anacleidesilvatorres9497 3 ปีที่แล้ว +1

    Awesome tutorial, congrats

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว

      Thank you! Cheers!

  • @monogalaxia
    @monogalaxia 2 ปีที่แล้ว +1

    Great tutorial, very understandable, but I think the way to import firebase to a project changed. You can't just import the whole object anymore...or am I missing something?

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว +1

      Yeah I think you're right a few people have mentioned this to me, I'll do some research and make an updated video :)

  • @bowlingverona
    @bowlingverona 3 ปีที่แล้ว +1

    Hej Tyler, thanks so much for this tutorial, amazing code.

    • @TylerPotts
      @TylerPotts  3 ปีที่แล้ว

      You're very welcome!

    • @bowlingverona
      @bowlingverona 3 ปีที่แล้ว

      @@TylerPotts I have request regarding auth with google email, are u gonna come up with something? That would be great ;=)

  • @explosive_monke
    @explosive_monke 2 ปีที่แล้ว +1

    amazing video, thank you so much, sir

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว

      Glad you liked it

  • @hillno
    @hillno 3 ปีที่แล้ว +1

    One question I can't figure out. Your code catches the errors of auth with ...catch(err => alert(err.message)); but how can we pass this up to the data level to make it more useful for error handling?

  • @xcrunnr12
    @xcrunnr12 2 ปีที่แล้ว +1

    Great Tut. However, I am wondering if there is a reason that you create the Logout function in the setup section instead creating it with the methods?

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว

      It's best to use the setup call when using the composition api :D

  • @bookspage9019
    @bookspage9019 2 ปีที่แล้ว

    thank you so much you are amazing person.

  • @kalenzo78
    @kalenzo78 3 ปีที่แล้ว +1

    Thanks for the great work, I humbly request you to make one react tutorial with redux

    • @TylerPotts
      @TylerPotts  3 ปีที่แล้ว

      I will be doing a React version but I will not be using Redux.

  • @codecombination9337
    @codecombination9337 3 ปีที่แล้ว

    Hi great video,
    I myself am exploring and learning vue js
    I wanted to ask why you didn't do the login and register functionality isndie methods:
    i mean by making functions

  • @tidenegocios
    @tidenegocios 3 ปีที่แล้ว +1

    Thank you very much!

  • @souvikkumarbarua5557
    @souvikkumarbarua5557 3 ปีที่แล้ว +1

    Hey can you make a video on how to save images in firebase and get the url using vue composition api

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว +1

      Thanks for the idea I'll add it to my list

  • @yasayah7289
    @yasayah7289 2 ปีที่แล้ว

    Rather than allow just anyone to register, how could you require admin approval before users/guests can login?

  • @hillno
    @hillno 3 ปีที่แล้ว +1

    Another Great one!

    • @TylerPotts
      @TylerPotts  3 ปีที่แล้ว

      Thank you! Cheers!

  • @philippeb1039
    @philippeb1039 2 ปีที่แล้ว

    Why isn't there are register with firstname, lastname and address?
    Then it would be more then just a copy paste from the documentation.

  • @PraveenKumar-ft2kr
    @PraveenKumar-ft2kr 3 ปีที่แล้ว

    Great session 👌👌👏👏😄

  • @kethanvemuri7594
    @kethanvemuri7594 3 ปีที่แล้ว

    Sir can you make video about best extensions for vue js in vs code

  • @OverDrive804
    @OverDrive804 3 ปีที่แล้ว +1

    This is great! React version please?

    • @TylerPotts
      @TylerPotts  3 ปีที่แล้ว +1

      Definitely one coming! It may have to be mid-week :)

  • @Kelevra501
    @Kelevra501 3 ปีที่แล้ว +1

    Hey your github repo is just the initial commit and not the final product!

  • @tr5946
    @tr5946 3 ปีที่แล้ว +1

    awesome awesome awesome

  • @estebanxelhuantzi
    @estebanxelhuantzi 3 ปีที่แล้ว

    If i have a function on a constant that recieves a parameter, how do i return it on the return section?

  • @samirmouzaoui5652
    @samirmouzaoui5652 3 ปีที่แล้ว

    thank you

    • @TylerPotts
      @TylerPotts  3 ปีที่แล้ว +1

      You're welcome

  • @robertoperez7468
    @robertoperez7468 3 ปีที่แล้ว +2

    Good Video, I would like you to do the firebase and Google autentication. It'll help a lot Thanks!

  • @jervi_sir
    @jervi_sir 2 ปีที่แล้ว

    thank you, what about role based auth, how would we manage to do it

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว

      Thank you for watching! However, I can't answer that question I'm a comment 😅 Maybe I'll cover it in a video!

  • @rogadev
    @rogadev 3 ปีที่แล้ว

    Am I just not understanding something or did you just expose your entire firebase account by including it in main.js like that? How is your apikey and other sensitive credentials protected? Does npm run build take care of protecting this information or can anyone see these details inside inspect > sources?

  • @theomegamale5335
    @theomegamale5335 2 ปีที่แล้ว +1

    Literally the only tutorial on this topic without a bunch of unnecessary BS convoluting everything. Great work....until you said tabs over spaces.

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว

      Haha thanks! HOWEVER, TABS > SPACES ANY DAY!

  • @Akosiyawin
    @Akosiyawin 3 ปีที่แล้ว

    Hello! Is it safe using vue for authenticating? and for CRUD operation in database? Should I use or implement node js?

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว

      As long as Firebase is managing the keys its safe to a degree however I believe it is safer to use Nuxt with SSR for the authentication along with firebase.

  • @wasd3108
    @wasd3108 3 ปีที่แล้ว

    repo linked is empty/base template

  • @ivanarabome4172
    @ivanarabome4172 ปีที่แล้ว

    he said we're going to create our "react app"

  • @kelanconway2009
    @kelanconway2009 3 ปีที่แล้ว

    Hi there, i've done everything correct but when registering it says password must be 6 characters long or more? i've used password123 and still comes up this error. Any help? thanks :)

    • @kelanconway2009
      @kelanconway2009 3 ปีที่แล้ว

      doesn't matter sorry, but really enjoying the video thanks!!

  • @UladzislauNikitsiuk
    @UladzislauNikitsiuk 3 หลายเดือนก่อน

    its getting old a bit, now is modular API. But big thanks, go docs gyus

  • @almostworthy2973
    @almostworthy2973 3 ปีที่แล้ว

    initializeApp isn't a function "TypeError: firebase.initializeApp is not a function"

  • @ksriharsha2911
    @ksriharsha2911 3 ปีที่แล้ว +1

    🔥❤️🔥👍👍👍👍

  • @moas98
    @moas98 2 ปีที่แล้ว

    them name plz

  • @ismendoza
    @ismendoza ปีที่แล้ว

    Thank you , you helped me a lot, but I noticed that if I use this code of below in home, about or other view, then the page is protected
    onBeforeMount( () => {
    auth.onAuthStateChanged((user) => {
    if(!user) {
    router.replace('Login');
    } else if(route.path == "Login"){
    router.replace('/');
    }
    })
    })
    Using this code in every view is the right way to protect every view?

  • @lolashepota4050
    @lolashepota4050 3 ปีที่แล้ว +1

    Tyler, thank you very much for understandable and cool tutorial. Well done!

  • @hillewiedahlin4916
    @hillewiedahlin4916 2 ปีที่แล้ว +1

    Awesome tutorial, helped me alot!

    • @TylerPotts
      @TylerPotts  2 ปีที่แล้ว

      Happy it helped! :D

  • @Clarabaralingonsylt
    @Clarabaralingonsylt 3 ปีที่แล้ว

    Thank you !!