Commit 06016c225d5947b9722b3421f3a79dbc6618d400

Authored by Alexandre Barbosa
1 parent 075773a6
Exists in webfinger_server

user information webfinger route

Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
Signed-off-by: Victor Arnaud <victorhad@gmail.com>
app/controllers/public/search_controller.rb
... ... @@ -135,6 +135,21 @@ class SearchController &lt; PublicController
135 135 end
136 136 end
137 137  
  138 + def webfinger
  139 +
  140 + @people = nil
  141 + if params[:resource]
  142 + @people = Profile[params[:resource]]
  143 + end
  144 +
  145 + render :json => @people.to_json
  146 +
  147 + #respond_to do |format|
  148 + # format.html
  149 + # format.json { render :json => @people.to_json }
  150 + #end
  151 + end
  152 +
138 153 def tag
139 154 @tag = params[:tag]
140 155 tag_str = @tag.kind_of?(Array) ? @tag.join(" ") : @tag.to_str
... ...
config/routes.rb
... ... @@ -15,6 +15,9 @@ Noosfero::Application.routes.draw do
15 15 ## Public controllers
16 16 ######################################################
17 17  
  18 + # webfinger route
  19 + match '/.well-known/webfinger', controller: 'search', action: 'webfinger', via: :all
  20 +
18 21 match 'test/:controller(/:action(/:id))', controller: /.*test.*/, via: :all
19 22  
20 23 # -- just remember to delete public/index.html.
... ...