Commit 02ad2841 authored by Matt Walsh's avatar Matt Walsh

Allow discover by userid - issue 28517

parent 40cd5082
...@@ -71,11 +71,16 @@ module API ...@@ -71,11 +71,16 @@ module API
end end
# #
# Discover user by ssh key # Discover user by ssh key or user id
# #
get "/discover" do get "/discover" do
key = Key.find(params[:key_id]) if params[:key_id]
present key.user, with: Entities::UserSafe key = Key.find(params[:key_id])
user = key.user
elsif params[:user_id]
user = User.find_by(id: params[:user_id])
end
present user, with: Entities::UserSafe
end end
get "/check" do get "/check" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment