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

Allow discover by userid - issue 28517

parent 40cd5082
......@@ -71,11 +71,16 @@ module API
end
#
# Discover user by ssh key
# Discover user by ssh key or user id
#
get "/discover" do
key = Key.find(params[:key_id])
present key.user, with: Entities::UserSafe
if params[:key_id]
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
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