OAuth2 using Google, PocketBase, and SvelteKit

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ต.ค. 2024

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

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

    This was a much needed video. PocketBase + Svelte + OAuth combo is amazing for quick side projects!

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

      Glad you will find it helpful then! Thank you for watching! I appreciate the support.

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

    Thank you for the useful information.

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

      You are very welcome! Thank you for watching! I appreciate your support!

  • @justin8mux
    @justin8mux 2 หลายเดือนก่อน

    Thanks man! You gave me hope for tomorrow, to fix OAuth2 flow in my project :)

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

    Thank you for another great video, much appreciated 💯👍

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

      You are very welcome! I am going to do at least one more on OAuth because I want to make sure everyone that isn't using PocketBase and SvelteKit knows other ways of using OAuth and Google. Thank you for your support!

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

    great video, i was actually struggling with this yesterday and this is the approach i like the most. I do have a question though. Do we need to create an instance of pocketbase inside hooks? this means a new instance per request right? is using a single pocketbase instance under, say $lib, not recommended for some reason?

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

      Hey Paolo, sorry for the delayed response. Thank you for watching and I am glad that you have found this video helpful. On to your questions. For the first one no, you don't have to create an instance of PocketBase inside of you handle hook. That is correct, a new client would be created every time a request was sent to the server. Lastly, if you want to put the creation of your pocketbase into $lib you just need to make sure that you put it in filename.server.js or filename.server.ts to make it a server side only module to avoid exposing it to any client side code. Thank you again for watching and for jumping into the comment section! I apologize again for the delayed response. Have a great day!

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

    thank you, how do I use the name from the object i get from google auth?

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

    This is perfect, just what I was looking for, thanks a lot for your great work

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

      Thank you again for watching and for commenting. I am glad you found it helpful and I hope you find more you like in my upcoming list (www.youtube.com/@ConsultingNinja/community)

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

    Thanks alot...❤️! Was struggling to implement oauth in Sveltkit using Pocketbase... Your video helped.

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

    awesome as usual .. is pocketbase ready for production? planning to build app w/ it

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

      You can use it, but there may be breaking changes up until version 1.0. That doesn't mean you can't use it. It just means that there is a possibility that in one of the updates from now until 1.0 there might be a change that you have to manually adjust something to work with the new version.

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

    Thank you again for these helpful videos! If after I set this up, I want to use the credentials to limit user's access to a functionality (say an application svelde page), what would I do?

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

      You are welcome! You can set them in your locals and use them to restrict access in your load functions. I have done a video on that here you can use: th-cam.com/video/uAP1EJmnqR0/w-d-xo.html
      If you have found this helpful please be sure to share or consider joining my channel membership if you are able : th-cam.com/channels/wPrPv9eS7Xgfp_wi7uxt0g.htmljoin

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

    Great tutorial! thank you!

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

      You are most welcome! I am not done with Auth yet. If you liked this one, you will like the next ones as well!

  • @techidea3601
    @techidea3601 6 หลายเดือนก่อน

    why when i logout and login again and it get 500 error code? tysm

  • @PhuongPhan-lj1tc
    @PhuongPhan-lj1tc ปีที่แล้ว

    hello! Im getting 'Undefined" with expectedState and expectedVerifier. It seems like I couldnt get the `cookies.get` values for some reason??

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

      Were you able to figure it out? If not can you post the snippets where you set the cookie and retrieve the cookie?

    • @PhuongPhan-lj1tc
      @PhuongPhan-lj1tc ปีที่แล้ว

      @@ConsultingNinja Where could I post these snippets? 🤣

    • @PhuongPhan-lj1tc
      @PhuongPhan-lj1tc ปีที่แล้ว

      @@ConsultingNinja and not yet. I basiaclly set these cookies exactly like how you did it. When I console.log on my signup/+page.server.js. I saw the cookies. But on my oauth/+server.js, My console.log on `cookies.get` is undefined :(

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

      email me

    • @PhuongPhan-lj1tc
      @PhuongPhan-lj1tc ปีที่แล้ว

      @@ConsultingNinja i jsut emailed you. Thank you

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

    Hello, why do we do it in the server? I don't want to depend on the server for this.

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

      Hello, There is no way to implement oAuth without using a backend. If you did it in the front end you would just be throwing away any security. NOTHING available client side is secure. There is a low code implementation that you can implement using mostly front-end code, but you will still need one backend route to verify the token coming back from Google. That way is much easier I will say. if you want to see that check out this video: th-cam.com/video/rrSfsxFq0Dw/w-d-xo.html

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

    Does this change implented in pocketbase v0.15 affect your code? Could your code be simplifyed with it?
    github.com/pocketbase/pocketbase/issues/55#issuecomment-1502980993

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

      This was not working last I checked (the time of release). So I couldn't say for sure just yet if it is now.