projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3193423
)
Assign token to connection
author
Martin Kühl
<martin.kuehl@gmail.com>
Tue, 18 Sep 2018 09:39:06 +0000
(11:39 +0200)
committer
Martin Kühl
<martin.kuehl@gmail.com>
Sat, 22 Sep 2018 05:04:01 +0000
(07:04 +0200)
lib/pleroma/plugs/oauth_plug.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/plugs/oauth_plug.ex
b/lib/pleroma/plugs/oauth_plug.ex
index 0380ce14db4d0dac270686ad5a8d5633f01d3286..651485e092d53fbf1d7ded4828e599246859d762 100644
(file)
--- 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