mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-24 10:07:24 +00:00
Web.MastodonAPI.MastodonSocket: Put access_token at function-level
This commit is contained in:
parent
5346fabf14
commit
d388a99143
|
@ -11,9 +11,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonSocket do
|
||||||
timeout: :infinity
|
timeout: :infinity
|
||||||
)
|
)
|
||||||
|
|
||||||
def connect(params, socket) do
|
def connect(%{"access_token" => token} = params, socket) do
|
||||||
with token when not is_nil(token) <- params["access_token"],
|
with %Token{user_id: user_id} <- Repo.get_by(Token, token: token),
|
||||||
%Token{user_id: user_id} <- Repo.get_by(Token, token: token),
|
|
||||||
%User{} = user <- Repo.get(User, user_id),
|
%User{} = user <- Repo.get(User, user_id),
|
||||||
stream
|
stream
|
||||||
when stream in [
|
when stream in [
|
||||||
|
|
Loading…
Reference in a new issue