BigW Consortium Gitlab

Commit 026455cf by Douwe Maan

Merge branch '28517-discover-by-userid' into 'master'

Allow discover by userid - issue 28517 Closes #28517 See merge request !12314
parents 4f03adf2 02ad2841
......@@ -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