Update token.ex

This commit is contained in:
Maxim Filippov 2019-02-11 09:48:24 +00:00
parent 62a45bdc11
commit 760fec4cb8
1 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ def create_token(%App{} = app, %User{} = user) do
def delete_user_tokens(%User{id: user_id}) do
from(
t in Pleroma.Web.OAuth.Token,
t in Token,
where: t.user_id == ^user_id
)
|> Repo.delete_all()
@ -55,7 +55,7 @@ def delete_user_tokens(%User{id: user_id}) do
def delete_user_token(%User{id: user_id}, token_id) do
from(
t in Pleroma.Web.OAuth.Token,
t in Token,
where: t.user_id == ^user_id,
where: t.id == ^token_id
)