aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2018-11-24 06:43:03 +0100
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2018-11-24 06:43:03 +0100
commitd388a991433151eb8d4fd07ad732d2f166ac295b (patch)
treecd4a01f22b4fa702c9eddb469246c3cc129cc07f
parent5346fabf142c19c8442b4421ad3f827ad050ec92 (diff)
downloadpleroma-d388a991433151eb8d4fd07ad732d2f166ac295b.tar.gz
Web.MastodonAPI.MastodonSocket: Put access_token at function-level
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_socket.ex5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_socket.ex b/lib/pleroma/web/mastodon_api/mastodon_socket.ex
index 46ec5ecd2..f3c13d1aa 100644
--- a/lib/pleroma/web/mastodon_api/mastodon_socket.ex
+++ b/lib/pleroma/web/mastodon_api/mastodon_socket.ex
@@ -11,9 +11,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonSocket do
timeout: :infinity
)
- def connect(params, socket) do
- with token when not is_nil(token) <- params["access_token"],
- %Token{user_id: user_id} <- Repo.get_by(Token, token: token),
+ def connect(%{"access_token" => token} = params, socket) do
+ with %Token{user_id: user_id} <- Repo.get_by(Token, token: token),
%User{} = user <- Repo.get(User, user_id),
stream
when stream in [