Verified Commit d388a991 authored by Haelwenn's avatar Haelwenn
Browse files

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

parent 5346fabf
Pipeline #4657 passed with stages
in 7 minutes and 12 seconds
......@@ -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),
when stream in [
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment