diff options
author | href <href+git-pleroma@random.sh> | 2019-02-28 11:18:01 +0000 |
---|---|---|
committer | href <href+git-pleroma@random.sh> | 2019-02-28 11:18:01 +0000 |
commit | a47cc5a2cf808b6a06d4d17f195b6a98458ad89d (patch) | |
tree | 0f32e4326f584f3f846a2126d860b217e2bc332c /lib/pleroma/web/oauth/oauth_controller.ex | |
parent | cf426a719dfe26a11b0bf0a22a08fd45ca5b9dc2 (diff) | |
parent | 3281a3f074f8aac6a05a24cc2eee4e5bad2275bd (diff) | |
download | pleroma-a47cc5a2cf808b6a06d4d17f195b6a98458ad89d.tar.gz |
Merge branch 'customizable_auth' into 'develop'
Authenticator tweaks
See merge request pleroma/pleroma!875
Diffstat (limited to 'lib/pleroma/web/oauth/oauth_controller.ex')
-rw-r--r-- | lib/pleroma/web/oauth/oauth_controller.ex | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex index 5c2b0507c..b16e3b2a7 100644 --- a/lib/pleroma/web/oauth/oauth_controller.ex +++ b/lib/pleroma/web/oauth/oauth_controller.ex @@ -5,7 +5,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do use Pleroma.Web, :controller - alias Pleroma.Web.Auth.DatabaseAuthenticator + alias Pleroma.Web.Auth.Authenticator alias Pleroma.Web.OAuth.Authorization alias Pleroma.Web.OAuth.Token alias Pleroma.Web.OAuth.App @@ -25,9 +25,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do available_scopes = (app && app.scopes) || [] scopes = oauth_scopes(params, nil) || available_scopes - template = Pleroma.Config.get(:auth_template, "show.html") - - render(conn, template, %{ + render(conn, Authenticator.auth_template(), %{ response_type: params["response_type"], client_id: params["client_id"], available_scopes: available_scopes, @@ -45,7 +43,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do "redirect_uri" => redirect_uri } = auth_params }) do - with {_, {:ok, %User{} = user}} <- {:get_user, DatabaseAuthenticator.get_user(conn)}, + with {_, {:ok, %User{} = user}} <- {:get_user, Authenticator.get_user(conn)}, %App{} = app <- Repo.get_by(App, client_id: client_id), true <- redirect_uri in String.split(app.redirect_uris), scopes <- oauth_scopes(auth_params, []), @@ -98,7 +96,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do |> authorize(auth_params) error -> - DatabaseAuthenticator.handle_error(conn, error) + Authenticator.handle_error(conn, error) end end |