pow-auth / pow

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

Phoenix 1.6 App upgraded to 1.7 warning about layout conflicts. #718

Closed RyanFleck closed 7 months ago

RyanFleck commented 10 months ago

After upgrading to 1.7 and navigating to any Pow layout, I am met with this information.

Has anybody seen this? What did I miss when upgrading my Phoenix app?

warning: conflicting layouts found. A layout has been set with format, such as:

    put_layout(conn, html: {Pow.Phoenix.Layouts, :app})

But also without format:

    put_layout(conn, {AttendanceWeb.LayoutView, :app})

In this case, the layout without format will always win.
Passing the layout without a format is currently soft-deprecated.
If you use layouts with formats, make sure that they are
used everywhere. Also remember to configure your controller
to use layouts with formats:

    use Phoenix.Controller, layouts: [html: {Pow.Phoenix.Layouts, :app}]

  (phoenix 1.7.10) lib/phoenix/controller.ex:1036: Phoenix.Controller.assigns_layout/3
  (phoenix 1.7.10) lib/phoenix/controller.ex:1016: Phoenix.Controller.prepare_assigns/4
  (phoenix 1.7.10) lib/phoenix/controller.ex:973: Phoenix.Controller.render_and_send/4
  (pow 1.0.34) lib/pow/phoenix/controllers/session_controller.ex:1: Pow.Phoenix.SessionController.action/2
  (pow 1.0.34) lib/pow/phoenix/controllers/session_controller.ex:1: Pow.Phoenix.SessionController.phoenix_controller_pipeline/2
  (phoenix 1.7.10) lib/phoenix/router.ex:432: Phoenix.Router.__call__/5
  (attendance 0.1.0) lib/attendance_web/endpoint.ex:1: AttendanceWeb.Endpoint.plug_builder_call/2
  (attendance 0.1.0) deps/plug/lib/plug/debugger.ex:136: AttendanceWeb.Endpoint."call (overridable 3)"/2
  (attendance 0.1.0) lib/attendance_web/endpoint.ex:1: AttendanceWeb.Endpoint.call/2
  (phoenix 1.7.10) lib/phoenix/endpoint/sync_code_reload_plug.ex:22: Phoenix.Endpoint.SyncCodeReloadPlug.do_call/4
  (plug_cowboy 2.6.1) lib/plug/cowboy/handler.ex:11: Plug.Cowboy.Handler.init/2
  (cowboy 2.10.0) /home/r/Documents/Attendance/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
  (cowboy 2.10.0) /home/r/Documents/Attendance/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
  (cowboy 2.10.0) /home/r/Documents/Attendance/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
  (stdlib 5.1.1) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
axelclark commented 8 months ago

@RyanFleck did you ever figure out how to resolve this warning? I'm getting the same warning in my project. I'm wondering if it is because I modified the templates and haven't updated them to the new HTML approach.

danschultzer commented 7 months ago

Fixed in v1.0.36, thanks for the report!