pow-auth / pow

Robust, modular, and extendable user authentication system
https://powauth.com
MIT License
1.59k stars 153 forks source link

Upgrading to Phoenix 1.7 #681

Closed charlottemoche closed 1 year ago

charlottemoche commented 1 year ago

I am in the process of upgrading from Phoenix 1.6 to 1.7 and I can see that pow currently only supports 1.6. When trying to start the server, I'm receiving this error:

== Compilation error in file lib/scorpion_web/router.ex ==
** (UndefinedFunctionError) function Phoenix.Router.Route.exprs/1 is undefined or private. Did you mean:

      * exprs/2

    (phoenix 1.7.0-rc.0) Phoenix.Router.Route.exprs(%Phoenix.Router.Route{verb: :get, line: 254, kind: :match, path: "/session/new", hosts: [], plug: Pow.Phoenix.SessionController, plug_opts: :new, helper: "pow_session", private: %{}, pipe_through: [:browser], assigns: %{}, metadata: %{log: :debug}, trailing_slash?: false, warn_on_verify?: true})
    (pow 1.0.27) lib/pow/phoenix/router.ex:216: Pow.Phoenix.Router.any_matching_routes?/3
    (elixir 1.14.0) lib/enum.ex:4313: Enum.reject_list/2
    (pow 1.0.27) lib/pow/phoenix/router.ex:188: Pow.Phoenix.Router.__filter_resource_actions__/6
    lib/scorpion_web/router.ex:254: (module)

@danschultzer this appears to also be a pow_assent issue as well, tagging you because it looks like you're working on both repos.

TheFirstAvenger commented 1 year ago

I ran into the same issue, however it looks like it was fixed in master with this commit, waiting on a release now.

danschultzer commented 1 year ago

Yup, fixed in main. The compiler warning in #683 has been fixed as well.

I want to update the template logic as well to handle the change from view to component templating in Phoenix 1.7 before releasing. I might just release this one ASAP so you can use a relased Pow with Phoenix 1.7 although it'll then still depend on phoenix_view.

pankaj-ag commented 1 year ago

@danschultzer any plan to release this one? I am also in the process of upgrading from 1.6 to 1.7.

prehnRA commented 1 year ago

@danschultzer Could you please cut a release with the current changes? In our testing, the latest version has worked with Phoenix 1.7. As you say, it would still depend on phoenix_view, but for us an earlier release without component templating would be the preference. The reason is that our legendary_core hex package is dependent on pow, and we can't publish a Phoenix-1.7-compatible version of the package until our dependencies are Phoenix 1.7 compatible.

danschultzer commented 1 year ago

@prehnRA Right, I've released 1.0.28!

I'm also working on https://github.com/pow-auth/pow/tree/phoenix-view to get rid of phoenix_view, and default styling with tailwind instead of minimalist. This will be introduced in 1.0.29 if anyone is waiting for switch to component templating.