def deps do
[{:coherence, "~> 0.3.0"},
...]
end
Now update your coherece deps to get the latest version:
$ mix deps.update coherence
Coherence has moved away from recommeding that the :browser pipeline be used for protected resources to unprotected resources.
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
plug Coherence.Authentication.Session # remove the , login: true
end
Coherence starts using the keyword :protecte
for resources requiring authentication. So change the :public
pipeline to:
pipeline :protected do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
plug Coherence.Authentication.Session, protected: true # note that protected: true change here
end
Change the two coherence routes scope blocks:
scope "/" do
pipe_through :browser
coherence_routes # :public has been deprecated and the default is not public routes
end
scope "/" do
pipe_through :protected
coherence_routes :protected
end
or if you are using generated Coherence controllers:
scope "/", MyProject do
pipe_through :browser
coherence_routes
end
scope "/", MyProject do
pipe_through :protected
coherence_routes :protected
end
And, finally, add your unprotected routes blocks to use the :browser
pipeline and your protected routes to use the :protected
pipeline:
scope "/", MyProject do
pipe_through :browser
get "/", PageController, :index
end
scope "/", MyProject do
pipe_through :protected
resources "/posts", PostController
resources "/users", UserController
end
If you project has enabled the confirmable option, then you will need to update your database schema for the name change.
Create a new migration:
$ mix ecto.gen.migration alter_confirmation_send_at
* creating priv/repo/migrations
* creating priv/repo/migrations/20160804011958_alter_confirmation_send_at.exs
Edit the miration file:
defmodule MyProject.Repo.Migrations.AlterConfirmationSendAt do
use Ecto.Migration
def change do
rename table(:users), :confirmation_send_at, to: :confirmation_sent_at
end
end
Run the migration:
$ mix ecto.migrate
There have been a number of changes to the controllers and the view helpers. You may want to rerun the installer and select yes for the files that you want to replace. If your code is commited to git before you run the installer again, you can aways do a git checkout file to restore any file changes you don't want to keep.
$ mix phoenix.server