mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 11:19:19 +00:00
Web.MastodonAPI.MastodonSocket: Put access_token at function-level
This commit is contained in:
parent
5346fabf14
commit
d388a99143
1 changed files with 2 additions and 3 deletions
|
@ -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