projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fc42e71
)
Add a function to lookup client app details by the app_id
author
Mark Felder
<feld@feld.me>
Tue, 9 Feb 2021 20:41:58 +0000
(14:41 -0600)
committer
Mark Felder
<feld@feld.me>
Tue, 9 Feb 2021 22:59:58 +0000
(16:59 -0600)
lib/pleroma/web/o_auth/app.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/o_auth/app.ex
b/lib/pleroma/web/o_auth/app.ex
index 38275001036177a142cb0f2d436242bd2cc9063a..083b5ce092075cb4602b49c3ad760ac190da06ad 100644
(file)
--- a/
lib/pleroma/web/o_auth/app.ex
+++ b/
lib/pleroma/web/o_auth/app.ex
@@
-146,4
+146,14
@@
defmodule Pleroma.Web.OAuth.App do
Map.put(acc, key, error)
end)
end
+
+ @spec get_app_by_id(pos_integer()) :: {:ok, map()}
+ def get_app_by_id(app_id) do
+ query =
+ __MODULE__
+ |> where([a], a.id == ^app_id)
+ |> select([a], %{name: a.client_name, website: a.website})
+
+ Repo.one!(query)
+ end
end