diff options
author | lain <lain@soykaf.club> | 2019-07-29 16:30:47 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-07-29 16:30:47 +0000 |
commit | 1dfde4151ca096742da593160d33a629494c9f1c (patch) | |
tree | 8999d2c1ccdea93e55e1ac7961778bc8d9054873 /lib/pleroma/web/oauth | |
parent | 3b8cd27b053e08bfb06a248033477efdb9e78684 (diff) | |
parent | b93498eb5289dc92587b77c316ed9f697bb9e5c8 (diff) | |
download | pleroma-1dfde4151ca096742da593160d33a629494c9f1c.tar.gz |
Merge branch 'refactor/use-constants' into 'develop'
refactoring: begin to use constants
See merge request pleroma/pleroma!1500
Diffstat (limited to 'lib/pleroma/web/oauth')
-rw-r--r-- | lib/pleroma/web/oauth/oauth_controller.ex | 3 | ||||
-rw-r--r-- | lib/pleroma/web/oauth/token.ex | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex index ef53b7ae3..81eae2c8b 100644 --- a/lib/pleroma/web/oauth/oauth_controller.ex +++ b/lib/pleroma/web/oauth/oauth_controller.ex @@ -365,8 +365,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do def register(%Plug.Conn{} = conn, %{"authorization" => _, "op" => "connect"} = params) do with registration_id when not is_nil(registration_id) <- get_session_registration_id(conn), %Registration{} = registration <- Repo.get(Registration, registration_id), - {_, {:ok, auth}} <- - {:create_authorization, do_create_authorization(conn, params)}, + {_, {:ok, auth}} <- {:create_authorization, do_create_authorization(conn, params)}, %User{} = user <- Repo.preload(auth, :user).user, {:ok, _updated_registration} <- Registration.bind_to_user(registration, user) do conn diff --git a/lib/pleroma/web/oauth/token.ex b/lib/pleroma/web/oauth/token.ex index 90c304487..40f131b57 100644 --- a/lib/pleroma/web/oauth/token.ex +++ b/lib/pleroma/web/oauth/token.ex @@ -44,8 +44,7 @@ defmodule Pleroma.Web.OAuth.Token do |> Repo.find_resource() end - @spec exchange_token(App.t(), Authorization.t()) :: - {:ok, Token.t()} | {:error, Changeset.t()} + @spec exchange_token(App.t(), Authorization.t()) :: {:ok, Token.t()} | {:error, Changeset.t()} def exchange_token(app, auth) do with {:ok, auth} <- Authorization.use_token(auth), true <- auth.app_id == app.id do |