From: Martin Kühl Date: Tue, 18 Sep 2018 09:39:06 +0000 (+0200) Subject: Assign token to connection X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=c2d592c9c5db8e0392948d5fc589761f482fc4f7;p=akkoma Assign token to connection --- 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