Skip to content

Commit b402745

Browse files
committed
Update changelog upgrade instructions
1 parent b701d12 commit b402745

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

CHANGELOG.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,24 @@ This is a full rewrite of the library, and are several breaking changes. You're
88

99
Read the [ExOauth2Provider](https://github.com/danschultzer/ex_oauth2_provider) CHANGELOG.md for upgrade instructions.
1010

11-
### 2. Routes
11+
### 2. Configuration
1212

13-
Routes are now separated into api and non api routes. Update your routes like so:
13+
Configuration has been split up so now it should look like this (`:module` and `:current_resource_owner` should be moved to the separate configuration for PhoenixOauth2Provider):
14+
15+
```elixir
16+
config :my_app, ExOauth2Provider,
17+
repo: MyApp.Repo,
18+
resource_owner: MyApp.Users.User,
19+
# ...
20+
21+
config :my_app, PhoenixOauth2Provider,
22+
current_resource_owner: :current_user,
23+
web_module: MyAppWeb
24+
```
25+
26+
### 3. Routes
27+
28+
Routes are now separated into api and non api routes. Remove the old `oauth_routes/1` routes, and update your `router.ex` to look like this instead:
1429

1530
```elixir
1631
defmodule MyAppWeb.Router do
@@ -39,6 +54,12 @@ defmodule MyAppWeb.Router do
3954
end
4055
```
4156

42-
### 3. Templates and views
57+
Remember to remove the `:oauth_public` pipeline. The default `:api` pipeline will be used instead.
58+
59+
### 4. Templates and views
60+
61+
Remove the old `module: MyApp` setting in your PhoenixOauth2Provider configuration, and instead set `web_module: MyAppWeb`.
62+
63+
However, templates and views are no longer required to be generated so you can remove them and the `:web_module` configuration setting entirely if the default ones work for you.
4364

44-
Update `:module` to `:web_module` in your configuration. Templates and views are no longer required to be generated so you can remove them entirely if the default ones work for you.
65+
The easiest migration of templates and views are to just delete the folders (`lib/my_app_web/templates/{application, authorization, authorized_application}` and `lib/my_app_web/views/phoenix_oauth2_provider`), and then run `mix phoenix_oauth2_provider.gen.templates` to regenerate them. Then you can go into the templates and update them to use your old markup.

0 commit comments

Comments
 (0)