You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+25-4Lines changed: 25 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,24 @@ This is a full rewrite of the library, and are several breaking changes. You're
8
8
9
9
Read the [ExOauth2Provider](https://github.com/danschultzer/ex_oauth2_provider) CHANGELOG.md for upgrade instructions.
10
10
11
-
### 2. Routes
11
+
### 2. Configuration
12
12
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:
14
29
15
30
```elixir
16
31
defmoduleMyAppWeb.Routerdo
@@ -39,6 +54,12 @@ defmodule MyAppWeb.Router do
39
54
end
40
55
```
41
56
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.
43
64
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