ZastrixArundell
I am adding user Authentication to my webapp and for some reason I am having issues and really don’t know how to solve it (I don’t know if it’s an error on my side or a bug).
(Just as an heads up, I am using windows and I have nmake installed)
I try to add comeonin and Bcrypt like so:
{:comeonin, "~> 5.0"},
{:bcrypt_elixir, "~> 2.0"}
Then I do mix deps,get and mix deps.compile bcrypt_elixir, which works completely well and I don’t get any errors.
When I do mix phoenix.server I get the following warning (I am using hash_pwd_salt/1):
warning: function Comeonin.Bcrypt.hash_pwd_salt/1 is undefined or private. Did you mean one of:
* hashpwsalt/1
* hashpwsalt/2
If I try using hashpwsalt/1 I get:
** (exit) an exception was raised:
** (ArgumentError) Comeonin.Bcrypt.hashpwsalt has been removed.
Add {:bcrypt_elixir, "~> 2.0"} to the deps in your mix.exs file,
and use Bcrypt.hash_pwd_salt instead.
lib/comeonin/base.ex:32: Comeonin.Bcrypt.error/2
(ecto) lib/ecto/changeset.ex:1004: Ecto.Changeset.update_change/3
(dealmailer) web/controllers/user_controller.ex:12: Dealmailer.UserController.create/2
(dealmailer) web/controllers/user_controller.ex:1: Dealmailer.UserController.action/2
(dealmailer) web/controllers/user_controller.ex:1: Dealmailer.UserController.phoenix_controller_pipeline/2
(dealmailer) lib/dealmailer/endpoint.ex:1: Dealmailer.Endpoint.instrument/4
(dealmailer) lib/phoenix/router.ex:261: Dealmailer.Router.dispatch/2
(dealmailer) web/router.ex:1: Dealmailer.Router.do_call/2
(dealmailer) lib/dealmailer/endpoint.ex:1: Dealmailer.Endpoint.phoenix_pipeline/1
(dealmailer) lib/plug/debugger.ex:123: Dealmailer.Endpoint."call (overridable 3)"/2
(dealmailer) lib/dealmailer/endpoint.ex:1: Dealmailer.Endpoint.call/2
(plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
(cowboy) c:/Users/Zastrix/Documents/Phoenix/dealmailer-phoenix/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
Then I try to downgrade my versions:
{:comeonin, "~> 4.0"},
{:bcrypt_elixir, "~> 1.0"}
And I get the dependencies and compile, everything is okay. I don’t get warnings in console when I start the app but when I do actually run it… I get this again (I am using hashpwsalt/1 here)
** (exit) an exception was raised:
** (ArgumentError) Comeonin.Bcrypt.hashpwsalt has been removed.
Add {:bcrypt_elixir, "~> 2.0"} to the deps in your mix.exs file,
and use Bcrypt.hash_pwd_salt instead.
lib/comeonin/base.ex:32: Comeonin.Bcrypt.error/2
(ecto) lib/ecto/changeset.ex:1004: Ecto.Changeset.update_change/3
(dealmailer) web/controllers/user_controller.ex:12: Dealmailer.UserController.create/2
(dealmailer) web/controllers/user_controller.ex:1: Dealmailer.UserController.action/2
(dealmailer) web/controllers/user_controller.ex:1: Dealmailer.UserController.phoenix_controller_pipeline/2
(dealmailer) lib/dealmailer/endpoint.ex:1: Dealmailer.Endpoint.instrument/4
(dealmailer) lib/phoenix/router.ex:261: Dealmailer.Router.dispatch/2
(dealmailer) web/router.ex:1: Dealmailer.Router.do_call/2
(dealmailer) lib/dealmailer/endpoint.ex:1: Dealmailer.Endpoint.phoenix_pipeline/1
(dealmailer) lib/plug/debugger.ex:123: Dealmailer.Endpoint."call (overridable 3)"/2
(dealmailer) lib/dealmailer/endpoint.ex:1: Dealmailer.Endpoint.call/2
(plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
(cowboy) c:/Users/Zastrix/Documents/Phoenix/dealmailer-phoenix/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
I’m trying to set up Emacs with elixir-ls via lsp-mode and credo via Flycheck. This should mostly be preconfigured as Flycheck picks up c...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
wolfiton
Hi,
Can you update your bcrypt to use
{bcrypt, "~> 2.0.3"},Also have a look at the docs Bcrypt — bcrypt_elixir v3.3.2
Can you also share the file where you use bcrypt to register the users?
wolfiton
Also wouldn’t the function to hash and add a salt, be this
hash_pwd_salt/2?ZastrixArundell
Looks like I fixed the issue. It wasn’t a bug from compiling like I thought. I used this tutorial where I need to alias this:
Now when I read the Bcrypt example docs, it looked like that Bcrypt didn’t really need this alias in order to work. I tested it out and lo and behold I didn’t get an error.
I guess that I tried to alias a module which didn’t really exist or was not the one correct to use so my app didn’t really manage to find it, but it worked without the alias.
ezkemboi
When using using
the best way to encrypt password is using
For more information Check Bcrypt Docs
bnymn
As far as I understand, we don’t really need to use
comeonin. It seems like thatbcrypt_elixirdoes all the work. Is that correct?LostKobrakai
Yes and no.
comeoninstill holds the behaviour all the concrete packages implement. It’s a dependency of all of them. If you depend on the behaviour ofcomeoninand not just a single concrete implementation I feels it’s still good to listcomeoninas explicit dependency. Because switching to another password hashing package does not change your dependency on the common interface.