mikker / passwordless

🗝 Authentication for your Rails app without the icky-ness of passwords
MIT License
1.26k stars 85 forks source link

Bug: Release has outdated source for router_helpers.rb #156

Closed danwetherald closed 1 year ago

danwetherald commented 1 year ago

After fetching and unpacking the gem, it is clear that the route_helpers file is out of date, causing there to be issues using the controller param.

This is in the latest release 0.12.0:

def passwordless_for(resource, at: nil, as: nil)
      mount_at = at || resource.to_s
      mount_as = as || resource.to_s
      mount(
        Passwordless::Engine,
        at: mount_at,
        as: mount_as,
        defaults: {authenticatable: resource.to_s.singularize}
      )

      Passwordless.mounted_as = mount_as
    end
danwetherald commented 1 year ago

Unless I am not understanding something, it appears all the tagged releases are very outdated code, it feels like there is something very strange going on here. Are the changes to the code not being committed to the builds to rubygems?

Only way I can get anything to work is to point my Gemfile to the actual repo url.

So it looks like the Readme is way ahead of the release, finally figured this out once we found the Changelog.

Any idea why the docs are way ahead of the latest release? Can we get a release for the current Changelog?

puffo commented 1 year ago

I'm seeing the same problem. But I do see there's is a major release (with breaking changes) that still needs to be published to RubyGems but that probably needs a major version change.

As a quick fix, perhaps we can ensure that the github repo defaults to the latest major release?

Context:

I was attempting to use the routing helpers:

passwordless_for :uses, controller: 'sessions'

but it throws an error: gems/passwordless-0.12.0/lib/passwordless/router_helpers.rb:19:in 'passwordless_for': unknown keyword: :controller (ArgumentError)

danwetherald commented 1 year ago

Yup, this is due to the ruby gems bundle being very outdated, I was able to correct the issue for now by pointing my gemfile directly to the repo for the time being.

mikker commented 1 year ago

Hey there. You're correct in your diagnose. Passwordless is in the middle of its biggest update yet and master has several breaking changes from the most recent released versions.

There's absolutely nothing wrong with the released versions though. But if you're building something new, master is probably the best choice right now. There'll be a few more changes before the next release though.

danwetherald commented 1 year ago

Makes sense, only issue I see is that the current documentation is not for the latest release.

mikker commented 1 year ago

Added a note to the README.