4. Authentication using Guardian & Bcrypt for Elixir REST API Project

Поділитися
Вставка
  • Опубліковано 19 січ 2025

КОМЕНТАРІ • 66

  • @tim_from_braid
    @tim_from_braid Рік тому +2

    Hey man, can you explain why we need the pin operator when getting account by email email: ^email?

    • @JacobLuetzow
      @JacobLuetzow  Рік тому +4

      Hey! Absolutely. In the get account by email function, the pin operator (`^`) ensures that the `email` in the `where` clause matches the specific value passed to the function; without it, Elixir would treat `email` as a new variable in the query, leading to incorrect or unintended behavior.

    • @tim_from_braid
      @tim_from_braid Рік тому +1

      @@JacobLuetzow thanks for the fast explanation!

    • @sifr-in
      @sifr-in 5 місяців тому

      @@JacobLuetzow
      thanks for this too.

    • @MatheusCamposdaSilva
      @MatheusCamposdaSilva 5 місяців тому

      @@JacobLuetzow That pretty much explains why my function to check if a user exists wasn't working

  • @geedp6511
    @geedp6511 2 роки тому +7

    These videos are awesome. Please keep it going!

  • @patriqueporto
    @patriqueporto Рік тому +4

    Nice video man, I've been learning elixir for 3 months, and I found your channel by chance on youtube, your teaching didactics are very good, I'm learning a lot, thank you very much!

    • @JacobLuetzow
      @JacobLuetzow  Рік тому +1

      That's great. I love that I can help! Thanks for being here. If you haven't yet, join my discord lots of awesome people in there!

  • @mattcantstop
    @mattcantstop Рік тому +1

    Thanks for making this video and the time it takes. When you created the module for Guardian I didn’t really understand the functions you created, and I don’t think the video explained it. Just a point of feedback, but overall, I am liking the videos! Thanks for making them.

    • @JacobLuetzow
      @JacobLuetzow  Рік тому

      Glad you're enjoying them. If you haven't already, please join my Discord server. I'd love to help you understand anything you need help understanding. discord.gg/eHdE6Wca

  • @bakyt_yrysov
    @bakyt_yrysov Рік тому +2

    These videos are super helpful! Keep it up, please!

  • @DominicanRepublicInvestment
    @DominicanRepublicInvestment 2 роки тому +1

    Awesome work!! It has become a "weekly" routine to wait for your videos and keep on learning. Thank you for your hard work!

  • @SergueiCambour
    @SergueiCambour Рік тому +1

    Awesome! Go on! Everything becomes so clear with your content!

  • @aniltheblogger
    @aniltheblogger 2 роки тому +2

    your tutorials are Gold. Thanks

  • @pkphilips2
    @pkphilips2 2 роки тому +1

    Underrated channel! Thank you for the clear explanations. One request though - can you use a slightly more legible font colour.. the text being entered into comments was very difficult to read

    • @JacobLuetzow
      @JacobLuetzow  2 роки тому

      Thank you!
      I will take a look at that, the comments font color was difficult to read only?

  • @phanta5m
    @phanta5m 2 роки тому +1

    great work, your videos are easy to follow

  • @unusualmarketing9751
    @unusualmarketing9751 Рік тому +1

    This is soooooooooo good. Your channel is seriously underrated sir...keep 'em videos coming. Could you do one on the existing api app but how you'd handle multi tenancy?

    • @JacobLuetzow
      @JacobLuetzow  Рік тому

      Thank you for your positive feedback! I love your suggestion to cover multi-tenancy. I'll look into this, and I believe Ecto will be a valuable tool for handling this. Stay tuned to my channel for updates on this topic. Your support means a lot!

    • @unusualmarketing9751
      @unusualmarketing9751 Рік тому

      @@JacobLuetzow definitely man. Already subbed. Also where can I reach you for some help in an Phoenix app am building...just quick help..I learn fast

    • @JacobLuetzow
      @JacobLuetzow  Рік тому

      You should join my discord server, lots of smart people in there!

    • @unusualmarketing9751
      @unusualmarketing9751 Рік тому

      @@JacobLuetzow I will do that, thanks

  • @ruhnet
    @ruhnet 2 роки тому +3

    Very well explained!

  • @sifr-in
    @sifr-in 5 місяців тому +1

    though had to setup visual tools
    watching 4th vid with complete attention.
    excellent tutorial.
    can u make similar playlist for very similar whatsApp with plain javascript so that it becomes easy to implement in native android?
    (commenting after watching other videos and again starting back)
    thanks.

    • @JacobLuetzow
      @JacobLuetzow  5 місяців тому

      Thank you! Not sure if I’ll be making a WhatsApp project but I’ll definitely make more videos that will give you the knowledge you need to build one.

  • @saisaske1
    @saisaske1 Рік тому +1

    Thankyou for great tutorial🙏

  • @danimusbar
    @danimusbar 2 роки тому +1

    I love this, tks for sharing this Sir.. keep up 👍😁

  • @cryswerton-silva
    @cryswerton-silva 7 місяців тому +1

    Another great video. Thanks!

  • @monxian3994
    @monxian3994 2 роки тому +2

    These are great videos. Could you tell Blork to start numbering the videos.

    • @JacobLuetzow
      @JacobLuetzow  2 роки тому

      Thank you! I can definitely number them for ya.

  • @bakbak1830
    @bakbak1830 Рік тому +1

    these videos are super helpful. Is it possible to create rest api for phoenix liveview?

    • @JacobLuetzow
      @JacobLuetzow  Рік тому

      Yes, of course, you make the routes in your router like we did here.

  • @IrisBurner
    @IrisBurner Рік тому

    Hello there @elixirmentor what vscode theme are you using? Thank you.

    • @JacobLuetzow
      @JacobLuetzow  Рік тому +1

      Elixir Theme: marketplace.visualstudio.com/items?itemName=maiquitome.elixir-theme

  • @patric308
    @patric308 6 місяців тому

    how could I avoid the hash_password return when using authenticate function?

    • @JacobLuetzow
      @JacobLuetzow  6 місяців тому +1

      you could remove it from the `account_view.ex` or watch the next video and return the auth token.

    • @patric308
      @patric308 6 місяців тому

      @@JacobLuetzow My bad! Im using a new Phoenix version that has json instead of view kkk Im sorry. I would remove it before returning to the user in the json or controller. Maybe in the user's context.

  • @leilaaudibert516
    @leilaaudibert516 Рік тому

    Great videos. on Video #4, where the authentication is activated to create a token, the verification fails with a secret not found, despite having properly secret_key in config.exs. What could explain that? (Elixir 1.15.4 otp 26). Thanks again.

    • @leilaaudibert516
      @leilaaudibert516 Рік тому

      config.exs had the secret key set for RealDealApi and not RealDealApiWeb (noobie error).

    • @JacobLuetzow
      @JacobLuetzow  Рік тому

      It could be happening for many reasons. If you’re not already please join my Discord server and it’ll be much easier to help you troubleshoot things there. discord.gg/HcnjPsWATg

  • @Xrat88
    @Xrat88 2 роки тому +1

    Can you talk about error handling in the next tutorial? (Sending JSON errors in responses, etc)

    • @JacobLuetzow
      @JacobLuetzow  2 роки тому +1

      I might get to that in the next video. It will definitely be in the one after that. It just depends how fast I can get through things, I don't like going over 30 minute videos.

  • @maxralph01
    @maxralph01 Рік тому

    I have been stuck on part 4 here. Developing on a Windows. This seems to be peculiar to windows. Kindly help.
    Error on terminal when I try to run "mix guardian.gen.secret"
    ==> bcrypt_elixir
    could not compile dependency :bcrypt_elixir, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile bcrypt_elixir", update it with "mix deps.update bcrypt_elixir" or clean it with "mix deps.clean bcrypt_elixir"
    ==> real_deal_api
    ** (Mix) "nmake" not found in the path. If you have set the MAKE environment variable,
    please make sure it is correct.

    • @JacobLuetzow
      @JacobLuetzow  Рік тому

      If you haven't already, join my discord. Some windows guys in there can probably help you better than I could.

    • @maxralph01
      @maxralph01 Рік тому

      @@JacobLuetzow Joined. And I figured it out on my own too.
      Thanks.

    • @khalilkhawaja4909
      @khalilkhawaja4909 Рік тому

      @@maxralph01 hey, can you tell me what the problem was XD

    • @maxralph01
      @maxralph01 Рік тому +1

      @@khalilkhawaja4909 It's compilation issue peculiar to Windows. I resolved it already.

    • @tim_from_braid
      @tim_from_braid 11 місяців тому

      yah but can you tell us other how who are having the same issue?@@maxralph01

  • @AlexanderRoempke
    @AlexanderRoempke Рік тому

    i got errors regarding bcrypt and the hash_pwd_salt => remove the alias and recompile than it works

    • @AlexanderRoempke
      @AlexanderRoempke Рік тому

      The same worked for the verify password if you have any problems

    • @JacobLuetzow
      @JacobLuetzow  Рік тому +1

      In the schema file? I don't alias Bcrypt.

    • @AlexanderRoempke
      @AlexanderRoempke Рік тому

      @@JacobLuetzow i must have messed that one up, but i learned atleast something about alias.

  • @russpalermo
    @russpalermo Рік тому +2

    Thanks mentor. Useful on journey to end up with Ash - maybe you can consider an Ash series soon? Ideally a multi-tenant ash using subdomains for each tenant... :).
    FYI for everyone starting out like me to get latest version of a hex package do a 'mix hex-info ' eg mix hex-info guardian

    • @JacobLuetzow
      @JacobLuetzow  Рік тому

      multi-tenant would be a great topic. I am considering some Ash content, I just need to find some time to mess around with it.
      Thanks for the mix tip, as well!

  • @AlexanderRoempke
    @AlexanderRoempke Рік тому

    elixir does everything i miss from c#