Skip to content
Snippets Groups Projects
Verified Commit d388a991 authored by Haelwenn's avatar Haelwenn
Browse files

Web.MastodonAPI.MastodonSocket: Put access_token at function-level

parent 5346fabf
No related branches found
No related tags found
No related merge requests found
......@@ -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 [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment