From c2d592c9c5db8e0392948d5fc589761f482fc4f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20K=C3=BChl?= Date: Tue, 18 Sep 2018 11:39:06 +0200 Subject: [PATCH] Assign token to connection --- lib/pleroma/plugs/oauth_plug.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/plugs/oauth_plug.ex b/lib/pleroma/plugs/oauth_plug.ex index 0380ce14d..651485e09 100644 --- a/lib/pleroma/plugs/oauth_plug.ex +++ b/lib/pleroma/plugs/oauth_plug.ex @@ -18,10 +18,11 @@ defmodule Pleroma.Plugs.OAuthPlug do end with token when not is_nil(token) <- token, - %Token{user_id: user_id} <- Repo.get_by(Token, token: token), + %Token{user_id: user_id} = token <- Repo.get_by(Token, token: token), %User{} = user <- Repo.get(User, user_id), false <- !!user.info["deactivated"] do conn + |> assign(:token, token) |> assign(:user, user) else _ -> conn -- 2.45.2