abevoelker/devise-passwordless

Uninitialized constant Users error for expired links

adrienpoly opened this issue · 6 comments

Hello

Thanks for this great Gem.

For an expired link I am seeing a strange error that I have hard time understanding how to fix it.

The error happens in the call to warden

self.resource = warden.authenticate!(auth_options)

Capture d’écran 2021-04-26 à 7 27 00 AM

I tried this but still getting the same error

  def show
    self.resource = warden.authenticate!(auth_options)
    set_flash_message!(:notice, :signed_in)
    sign_in(resource_name, resource)
    yield resource if block_given?
    redirect_to after_sign_in_path_for(resource)
  rescue
    flash[:notice] = t("devise.failure.user.magic_link_invalid")
    redirect_to root_path
  end

sure the project is open source here https://github.com/hostolab/covidliste/blob/master/config/routes.rb

Lots of the issues and PR etc are in french but the code is all in English 😄

@adrienpoly Thank you very much for reporting; I believe this is a bug in my gem with certain routes not being calculated correctly. I've opened a PR on your project you can review to see if it fixes your issue: hostolab/covidliste#587

I am going to push an update to this project's generators to match the PR change so others won't encounter this problem.

Thanks for finding this!

This is awesome, thanks for your quick answer 🚀

I can confirm that it fixed the issue on our side thanks

Great, thanks for letting me know! I've released 0.6 version of the gem with a fixed generator.