Add OAuth tokens endpoint

This commit is contained in:
Maxim Filippov 2019-02-10 22:41:06 +03:00
commit 61a4bc5095
6 changed files with 75 additions and 0 deletions

View file

@ -52,4 +52,12 @@ defmodule Pleroma.Web.OAuth.Token do
)
|> Repo.delete_all()
end
def get_user_tokens(%User{id: user_id}) do
from(
t in Pleroma.Web.OAuth.Token,
where: t.user_id == ^user_id
)
|> Repo.all()
end
end