Assign token to connection
This commit is contained in:
parent
3193423be9
commit
c2d592c9c5
1 changed files with 2 additions and 1 deletions
|
@ -18,10 +18,11 @@ def call(conn, _) 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
|
||||
|
|
Loading…
Reference in a new issue