Search code examples
ruby-on-railsruby-on-rails-5devise-token-auth

uninitialized constant DeviseTokenAuth::Concerns::User::BCrypt


Using the devise_token_auth gem, I am making a rails-based API in which I am trying to reset my password using email.

On opening the email with reset link, I get this Error:

uninitialized constant DeviseTokenAuth::Concerns::User::BCrypt

The code points to Api::V1::Overrides::PasswordsController#edit

tokens[client_id] = {
  token: BCrypt::Password.create(token),
  expiry: expiry
}.merge!(token_extras)

What can I do to make my reset link to go onto my reset form?

I am following this for PasswordsController action Tried checking github but there no one actually has faced this sort of error and I cannot rectify it.

P.S. I am not an experienced Ruby developer.


Solution

  • Probably just missing the bcrypt gem, e.g. add this in your Gemfile:

    gem 'bcryt`