From: Haelwenn (lanodan) Monnier Date: Sat, 24 Nov 2018 05:43:03 +0000 (+0100) Subject: Web.MastodonAPI.MastodonSocket: Put access_token at function-level X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=d388a991433151eb8d4fd07ad732d2f166ac295b;p=akkoma Web.MastodonAPI.MastodonSocket: Put access_token at function-level --- 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 [